最近要在Win10配置PCL,网上有很多现成的教程,都写的不错,这里就不废话了。重点是我踩了一个好大的坑!!!没错是坑!!一定要记录一下,共勉共勉~~~
1. LINK1104:无法打开文件“.obj”
没错就是这货,我整整搞了一天!问题的关键就在属性表->链接器->输入->附加依赖项
因为PCL的附加依赖项很多,最方便的就是在网上直接拷贝人家的,但是再复制的时候一定要检查每个lib之间只有一个回车!

上图中圈出来的地方很有可能有两个回车,而你根本看不出来!
2. error C4996: 'std::copy::_Unchecked_iterators::_Deprecate': Call to 'std::copy' with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'
在工程属性—>C/C++—>命令行—>其他选项 中添加:
-D_SCL_SECURE_NO_WARNINGS
3. error C4996: 'pcl::SAC_SAMPLE_SIZE': This map is deprecated and is kept only to prevent breaking existing user...
属性->C/C++->SDL检查:改为否(/sdl)
4. 如果编译通过,但是在可视化后出现一下的提示错误,是说明了VTK的初始化错误,也就是VTK的组件出错了

在主程序中添加三行代码
#include <vtkAutoInit.h>
VTK_MODULE_INIT(vtkRenderingOpenGL);
VTK_MODULE_INIT(vtkInteractionStyle);
网友评论