win10 CMake VS2019 源码安装编译CloudCompare

6 篇文章 0 订阅
2 篇文章 0 订阅

官网下载地址:https://cmake.org/download/

或者github下载地址:https://github.com/cloudcompare/cloudcompare

参考:https://github.com/CloudCompare/CloudCompare/blob/master/BUILD.md

我的编译环境,相关安装配置在前面的博客有:

1、Windows 10

2、Visual Studio 2019

3、Qt5.13.1 开源版

4、CMake 3.15.2

解压下载文件

打开CMake编译,设置如下:

我选中了OPTION_MP_BUILD,其他默认。OPTION_MP_BUILD: for Visual Studio only (multi-process build --> much faster but uses a lot of CPU power)

设置QT5_ROOT_PATH 路径;然后单击“Configure”。

出现“Configuring done”之后,单击“Generate”。出现“Generating done”,关闭CMake即可。

用VS2019打开编译路径下的CloudCompareProjects.sln。右击“ALL_BUILD”——生成,等待就行。

出现错误:

error LNK2038: 检测到“_ITERATOR_DEBUG_LEVEL”的不匹配项: 值“0”不匹配值“2”(mocs_compilation.obj 中)
12>Qt5OpenGLExtensions.lib(qopenglextensions.obj) : error LNK2038: 检测到“RuntimeLibrary”的不匹配项: 值“MD_DynamicRelease”不匹配值“MDd_DynamicDebug”(mocs_compilation.obj 中)

解决:

产生这个问题的原因是当前工程是Debug版本,而引用的库文件时Release版本,只需要把当前的Debug模式改成Release模式就可以了,或者打开解决方案--》属性--》链接器--》输入--》附加依赖项中引用debug版本的lib文件名称。在这里将Debug模式改成Release模式。

You should always find the two following configuration/sub-projects:

  1. build all: does all the compilation work (in the right order) but the binaries and libraries will be generated (by default) among all the other compilation files, in a somewhat complicated folder tree structure.
  2. install: copies all the necessary files (executable, resources, plugins, DLLs etc.) to the CMAKE_INSTALL_PREFIX folder. This is mandatory to actually launch CloudCompare or ccViewer.

问题:由于找不到CC_CORE_LIB.dll、QCC_DB_LIB.dll、QCC_IO_LIB.dll,无法继续执行代码。。。。

解决:

      build\libs\qCC_io\Release下的QCC_IO_LIB.dll

      build\libs\qCC_db\Release下的QCC_DB_LIB.dll

      build\CC\Release下的CC_CORE_LIB.dll

将以上三个dll文件拷贝到build\qCC\Release 和 \build\ccViewer\Release下;

双击CloudCompare.exe(或者ccViewer.exe),可以加载部分格式的点云了。【部分功能编译是没有选择,所以功能不全面】

This application failed to start because it could not find or load the Qt platform plugin "windows" in "".

解决:在网上找了各种方法,发现我的VS与Qt连接的插件没有装好。Qt在VS中创建工程没有问题后,这个问题也消失了。

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值