1、下载CloudCompare源代码,解压(本人是放于 F:\1_CloudCompare);
2、下载CCCoreLib源代码,解压路径:F:\1_CloudCompare\libs\qCC_db\extern\CCCoreLib;
3、下载nanoflann源代码,解压路径:F:\1_CloudCompare\libs\qCC_db\extern\CCCoreLib\extern\nanoflann
4、打开CMake,添加路径:
5、添加变量
(1)CMAKE_PREFIX_PATH, 指向QT安装路径,如D:/Qt/5.15.2/msvc2019_64
(2)CMAKE_INSTALL_PREFIX,指定安装目录,如../Install
6、Configure & Generate
7、打开项目,编译
8、编译错误 C2653 “QCoreApplication”: 不是类或命名空间名称 CCCoreLib F:\1_CloudCompare\libs\qCC_db\extern\CCCoreLib\src\DgmOctree.cpp 3428
解决:
DgmOctree.h添加#include <QCoreApplication>
9、编译错误:E0135 namespace "nanoflann" 没有成员 "SearchParams" CCCoreLib F:\1_CloudCompare\libs\qCC_db\extern\CCCoreLib\src\Kriging.cpp 358
可能是代码版本不匹配,先不去管,做注释处理
10、编译错误:
错误 MSB6006 “rc.exe”已退出,代码为 2。 ccViewer C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets 1943
详细错误日志为:
TRACKER : 错误 TRK0002: 未能执行命令: “"E:\Windows Kits\10\bin\10.0.20348.0\x64\rc.exe" /D WIN32 /D _DEBUG /D _WINDOWS /D CC_VIEWER /D NOMINMAX /D _CRT_SECURE_NO_WARNINGS /D __STDC_LIMIT_MACROS /D QT_USE_QSTRINGBUILDER /D CC_CORE_LIB_USES_FLOAT /D CC_CORE_LIB_USES_QT_CONCURRENT /D QT_CONCURRENT_LIB /D QT_CORE_LIB /D QT_OPENGL_LIB /D QT_WIDGETS_LIB /D QT_GUI_LIB /D QT_OPENGLEXTENSIONS_LIB /D CC_DXF_SUPPORT /D CC_SHP_SUPPORT /D CMAKE_INTDIR=\"Debug\" /l0x0409 /IF:\1_CloudCompare\build\ccViewer\ccViewer_autogen\include_Debug /IF:\1_CloudCompare\plugins /IF:\1_CloudCompare\ccViewer /IF:\1_CloudCompare\ccViewer\..\qCC /IF:\1_CloudCompare\build\ccViewer /IF:\1_CloudCompare\libs\CCAppCommon\include /IF:\1_CloudCompare\libs\CCPluginAPI\include /IF:\1_CloudCompare\libs\CCPluginStub\include /IF:\1_CloudCompare\libs\qCC_glWindow\include /IF:\1_CloudCompare\libs\qCC_db\include /IF:\1_CloudCompare\build\libs\qCC_db\extern\CCCoreLib\exports /IF:\1_CloudCompare\libs\qCC_db\extern\CCCoreLib\include /IF:\1_CloudCompare\libs\qCC_db\extern\CCCoreLib\extern\nanoflann\include /IF:\1_CloudCompare\libs\CCFbo\include /IF:\1_CloudCompare\libs\qCC_io\include /IF:\1_CloudCompare\libs\qCC_io\extern\dxflib\src /IF:\1_CloudCompare\libs\qCC_io\extern\shapelib /ID:\Qt\5.15.2\msvc2019_64\include /ID:\Qt\5.15.2\msvc2019_64\include\QtConcurrent /ID:\Qt\5.15.2\msvc2019_64\include\QtCore /ID:\Qt\5.15.2\msvc2019_64\.\mkspecs\win32-msvc /ID:\Qt\5.15.2\msvc2019_64\include\QtOpenGL /ID:\Qt\5.15.2\msvc2019_64\include\QtWidgets /ID:\Qt\5.15.2\msvc2019_64\include\QtGui /ID:\Qt\5.15.2\msvc2019_64\include\QtANGLE /ID:\Qt\5.15.2\msvc2019_64\include\QtOpenGLExtensions /nologo /foccViewer.dir\Debug\cc_viewer_icon.res F:\1_CloudCompare\ccViewer\images\icon\cc_viewer_icon.rc”。拒绝访问。
15>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(1943,5): error MSB6006: “rc.exe”已退出,代码为 2。
解决:
F:\1_CloudCompare\ccViewer\images\icon\cc_viewer_icon.rc”。拒绝访问。
找到对应的CMake文件,将该行注释掉
11、生成成功!
12、运行CloudCompare
提示找不到库文件
解决:
生成INSTALL,将Install目录下的文件拷贝至运行目录,或者修改运行环境。
13、运行成功
标签:CCCoreLib,extern,qCC,编译,libs,include,CloudCompare From: https://www.cnblogs.com/hxqmw/p/17994573