我已经在vcpkg中安装了CGAL。还安装了带有vcpgk的Qt5。然后我下载了CGAL-5.0-examples并运行了cmake-gui ..。它做到了,没有错误。Qt5变量似乎指向vcpkg中的某些位置。不幸的是,在生成sln之后,我正在打开它,我不能构建它:
Severity Code Description Project File Line Suppression State Suppression State
Error LNK1104 cannot open file 'Debug\CGAL_Qt5_moc_and_resources.lib' for_loop_2 D:\dev\CGAL-5.0\examples\Triangulation_2\build\LINK 1
Error C1083 Cannot open source file: 'D:\dev\CGAL-5.0\examples\Triangulation_2\build\qrc_CGAL.cpp': No such file or directory CGAL_Qt5_moc_and_resources D:\dev\CGAL-5.0\examples\Triangulation_2\build\c1xx 1
Error C1083 Cannot open source file: 'D:\dev\CGAL-5.0\examples\Triangulation_2\build\qrc_Input.cpp': No such file or directory CGAL_Qt5_moc_and_resources D:\dev\CGAL-5.0\examples\Triangulation_2\build\c1xx 1
Error C1083 Cannot open source file: 'D:\dev\CGAL-5.0\examples\Triangulation_2\build\qrc_File.cpp': No such file or directory CGAL_Qt5_moc_and_resources D:\dev\CGAL-5.0\examples\Triangulation_2\build\c1xx 1
Error C1083 Cannot open source file: 'D:\dev\CGAL-5.0\examples\Triangulation_2\build\qrc_Triangulation_2.cpp': No such file or directory CGAL_Qt5_moc_and_resources D:\dev\CGAL-5.0\examples\Triangulation_2\build\c1xx 1 为什么它试图从构建目录打开cpp文件,尽管源代码目录是上一级目录?

发布于 2019-12-12 16:52:30
对于使用CGAL:vcpkg install cgal[qt]的示例,您需要安装cgalqt,它包含CGAL使用的大多数3D示例和演示的特定标头。
此外,将vcpkg与cmake一起使用也有其特殊性,因为在cmake中,Optional Platform的默认行为是x64,而在vcpkg中,默认行为是x86。这意味着如果你把它留空,来自vcpkg外部的所有东西都是x64的,vcpkg x86里面的所有东西都是x64的,你会遇到警告,链接错误,可能还会有一些构建错误。This page解释了使用vcpg配置和构建CGAL示例的步骤。
https://stackoverflow.com/questions/59290221
复制相似问题