[已解决]Target "main" links to target "Geogram::geogram" but the target was not f

问题描述:
在cmakelist中添加了动态库alicivison_fusecut后,cmake时提示

CMake Error at CMakeLists.txt:12 (add_executable):
  Target "main" links to target "Geogram::geogram" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?

心想可能是geogram版本的原因,又从1.5.2版本试到1.7.1版本,均未解决问题,查看源代码发现头文件等也显示正确,又仔细思考一遍问题,将问题源头定位在alicevision_fuse.so的编译过程,查看用来生成alicevision_fuse.so的cmakelist,果不其然,里面在动态库处添加了Geogram::geogram,所以在引用alicevision_fuse.so时,也会自动查找Geogram::geogram,电脑找不到Geogram::geogram就会报错。
解决方法:

1.卸载alicevision
2.打开ALicivion/src,将该文件及所有子文件下的cmakelist中Geogram::geogram,改成geogram,为了防止bosst和eigen也报这种问题,可以顺便把boost::filesystem,改成${BOOST_LIBRARIES},eigen3::eigen改成${EIGEN3_LIBRARY},
//提醒:在修改时要注意不要出错,如果在编译过程中出现未定义的引用或者其他原因,极大可能是在修改cmakelist时,犯了语法错误,注意检查
3.重新编译
4.安装软件即可
[已解决]Target "main" links to target "Geogram::geogram" but the target was not   f[已解决]Target "main" links to target "Geogram::geogram" but the target was not   f 本大人乐意 发布了76 篇原创文章 · 获赞 0 · 访问量 3388 私信 关注
上一篇:CentOS虚拟机和物理机共享文件夹


下一篇:八、MYSQL--用户权限