在vs2012中构建pcl时C ++ CMake FLANN失败 [英] C++ CMake FLANN failing when building pcl in vs2012

查看:348
本文介绍了在vs2012中构建pcl时C ++ CMake FLANN失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

试图在Windows 8.1的VS2012上构建PCL,以便我可以尝试将Kinect for Windows v2传感器与其集成在一起,但是我似乎遇到了很多我不知道该怎么办的CMake错误.部分原因是因为我对CMake不太熟悉,所以我在此处

Trying to build PCL on VS2012 in Windows 8.1 so I can attempt to integrate my Kinect for Windows v2 sensor with it, however I seem to be running into a bunch of CMake errors that I don't know what to do with. this is partially because I am not very familiar with CMake, and so I am following the tutorial here which outlines the building of dependencies using the CMake GUI. However, throughout this process I have found that the only things that have built properly are the ones I build using cmake in the command line. the errors are:

法兰克(FLANN):

For FLANN:

当尝试在VS2012中构建INSTALL时(这甚至没有涉及其他构建错误,但让我们从此处开始)我得到:

When trying to build INSTALL in VS2012 (this isn't even getting into the other build errors, but lets start here) I get:

错误21错误C2228:.serialize"的左侧必须具有 类/结构/联合D:\ flann-1.8.4-src \ flann-1.8.4-src \ src \ cpp \ flann \ util \ serialization.h 第18行:type.serialize(ar);错误24错误LNK1181:无法 打开输入文件 '.. \ lib \ Release \ flann.lib'D:\ flann-1.8.4-src \ flann-1.8.4-src \ build \ examples \ LINK 错误25错误MSB3073:命令"setlocal C:\ CMake \ bin \ cmake.exe -DBUILD_TYPE =如果%errorlevel%neq 0,则释放-P cmake_install.cmake转到:cmEnd:cmEnd endlocal&致电:cmErrorLevel%errorlevel%&去 :cmDone:cmErrorLevel退出/b%1:cmDone如果%errorlevel%neq 0转到 :VCEnd:VCEnd退出,代码为1.C:\ Program Files (x86)\ MSBuild \ Microsoft.Cpp \ v4.0 \ V110 \ Microsoft.CppCommon.targets 134

Error 21 error C2228: left of '.serialize' must have class/struct/union D:\flann-1.8.4-src\flann-1.8.4-src\src\cpp\flann\util\serialization.h line 18: type.serialize(ar); Error 24 error LNK1181: cannot open input file '..\lib\Release\flann.lib' D:\flann-1.8.4-src\flann-1.8.4-src\build\examples\LINK Error 25 error MSB3073: The command "setlocal C:\CMake\bin\cmake.exe -DBUILD_TYPE=Release -P cmake_install.cmake if %errorlevel% neq 0 goto :cmEnd :cmEnd endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone :cmErrorLevel exit /b %1 :cmDone if %errorlevel% neq 0 goto :VCEnd :VCEnd" exited with code 1. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets 134

对于VTK:

VTK_USE_QTOPENGL选项没有出现,即使我已经先启用了VTK_USE_QT,并且VS2012的项目生成崩溃了几次,但是却能够克服崩溃(我担心这对于实际使用VTK来说不是一个好兆头) )

the VTK_USE_QTOPENGL option is not appearing, even though I already first enable VTK_USE_QT, and project generation for VS2012 crashed a few times, but was able to move past the crashes (I worry that this doesn't bode well for actually using VTK)

对于Qhull:

与FLANN类似的错误:

similar error as FLANN:

错误1错误MSB3073:命令"setlocal C:\ CMake \ bin \ cmake.exe -DBUILD_TYPE =调试-P cmake_install.cmake如果%errorlevel%neq 0转到:cmEnd:cmEnd endlocal&致电:cmErrorLevel%errorlevel%&去 :cmDone:cmErrorLevel退出/b%1:cmDone如果%errorlevel%neq 0转到 :VCEnd:VCEnd退出,代码为1.C:\ Program Files (x86)\ MSBuild \ Microsoft.Cpp \ v4.0 \ V110 \ Microsoft.CppCommon.targets 134

Error 1 error MSB3073: The command "setlocal C:\CMake\bin\cmake.exe -DBUILD_TYPE=Debug -P cmake_install.cmake if %errorlevel% neq 0 goto :cmEnd :cmEnd endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone :cmErrorLevel exit /b %1 :cmDone if %errorlevel% neq 0 goto :VCEnd :VCEnd" exited with code 1. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets 134

,但其余部分构建良好.任何建议都将受到欢迎.

but the rest of it builds nicely. any advice would be welcome.

推荐答案

在Windows 7中使用VS2012构建PCL时,我遇到了类似的问题.

I had similar issues building PCL with VS2012 in Windows 7.

这是我解决的方法: 对于所有情况,请先以管理员身份打开 Visual Studio .

This is how I solved: For all cases, before open Visual studio as administrator.

法兰克

  1. 使用CMake,并在配置"中单击后,设置 BUILD_PYTHON_BINDINGS和BUILD_MATLAB_BINDINGS设置为OFF.
  2. 再次单击配置",然后单击生成".
  3. 打开solucion文件(以VS作为管理员).
  4. 编辑文件flann \ src \ cpp \ flann \ util \ serialization.h之后,在语句BASIC_TYPE_SERIALIZER(...)(在#93行中为aprox)之后添加以下几行: #ifdef _MSC_VER BASIC_TYPE_SERIALIZER(无符号__int64); #endif
  5. 在调试和发布配置中都构建ALL_BUILD项目和INSTALL项目.
  1. Use CMake and after click in "Configure", set the BUILD_PYTHON_BINDINGS and BUILD_MATLAB_BINDINGS to OFF.
  2. Click again in "Configure", then "Generate".
  3. Open the solucion file (with VS as administrator).
  4. Edit the file flann\src\cpp\flann\util\serialization.h adding after the statement BASIC_TYPE_SERIALIZER(...) (it is aprox in line #93) the following lines: #ifdef _MSC_VER BASIC_TYPE_SERIALIZER(unsigned __int64); #endif
  5. Build ALL_BUILD project and the INSTALL project, both in debug and release configuration.

QHUll

  1. 打开CMake,然后在单击配置"之前,单击添加条目"并按如下所示填写字段: 名称:CMAKE_DEBUG_POSTFIX 类型:STRING 值:_d
  2. 然后单击确定".
  3. 单击配置"两次,然后单击生成".
  4. 打开解决方案,并在调试和发行版配置中构建ALL_BUILD项目和INSTALL项目.
  1. Open CMake and before clicking on "Configure", click on "Add Entry" and fill the fields as follows: Name : CMAKE_DEBUG_POSTFIX Type : STRING Value : _d
  2. Then click "Ok".
  3. Click "Configure" twice and "Generate".
  4. Open the solution and build ALL_BUILD project and the INSTALL project, both in debug and release configuration.

VTK

  1. 打开CMake,然后单击配置",如果没有Qt4.x的环境变量,请手动找到: QT_QMAKE_EXECUTABLE到qmake.exe的位置 QT_QTCORE_librery_RELEASE QT_QTCORE_LIBRARY_DEBUG QT_MKSPECIF_DIR
  2. 打开解决方案,并在调试和发行版配置中构建ALL_BUILD项目和INSTALL项目.
  1. Open CMake and before clicking on "Configure", and if you didn't have the enviroment variables for Qt4.x manually locate: QT_QMAKE_EXECUTABLE to the location of qmake.exe QT_QTCORE_librery_RELEASE QT_QTCORE_LIBRARY_DEBUG QT_MKSPECIF_DIR
  2. Open the solution and build ALL_BUILD project and the INSTALL project, both in debug and release configuration.

希望它对您有用.

这篇关于在vs2012中构建pcl时C ++ CMake FLANN失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆