点云中图书馆简单的例子链接错误
我试图运行从http://pointclouds.org/documentation/tutorials/pcl_visualizer.php 以下PCL简单的浏览器的例子,我已经成功地构建使用C进行二叉树和推荐的CMakeLists.txt点云中图书馆简单的例子链接错误
代后,当我尝试建立它我得到以下错误:
error LNK2019: unresolved external symbol "public: void __thiscall pcl::visualization::PCLVisualizer::initCameraParameters(void)" ([email protected]@[email protected]@@QAEXXZ) referenced in function "class boost::shared_ptr<class pcl::visualization::PCLVisualizer> __cdecl simpleVis(class boost::shared_ptr<class pcl::PointCloud<struct pcl::PointXYZ> const >)" ([email protected]@[email protected]@[email protected]@@@[email protected]@[email protected][email protected]@[email protected]@@[email protected]@@[email protected]@Z)`
error LNK2019: unresolved external symbol "public: void __thiscall pcl::visualization::PCLVisualizer::addCoordinateSystem(double,int)" ([email protected]@[email protected]@@[email protected]) referenced in function "class boost::shared_ptr<class pcl::visualization::PCLVisualizer> __cdecl simpleVis(class boost::shared_ptr<class pcl::PointCloud<struct pcl::PointXYZ> const >)" ([email protected]@[email protected]@[email protected]@@@[email protected]@[email protected][email protected]@[email protected]@@[email protected]@@[email protected]@Z)
error LNK2019: unresolved external symbol "public: bool __thiscall pcl::visualization::PCLVisualizer::setPointCloudRenderingProperties(int,double,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,int)" ([email protected]@[email protected]@@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]) referenced in function "class boost::shared_ptr<class pcl::visualization::PCLVisualizer> __cdecl simpleVis(class boost::shared_ptr<class pcl::PointCloud<struct pcl::PointXYZ> const >)" ([email protected]@[email protected]@[email protected]@@@[email protected]@[email protected][email protected]@[email protected]@@[email protected]@@[email protected]@Z)
而这些只是一些......我错过了cmakelists.txt中的东西?
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
project(pcl_visualizer_viewports)
find_package(PCL 1.5.1 REQUIRED)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
add_executable (pcl_visualizer_demo pcl_visualizer_demo.cpp)
target_link_libraries (pcl_visualizer_demo ${PCL_LIBRARIES})
任何帮助表示赞赏。谢谢
发现问题所在:尽管我运行的是64位机器,但我的编译器(VS2010)配置为32位,因此我需要卸载64位Point Cloud Library并安装32位版本。现在它可以工作。经验教训:D
)编译器可用于32位或64位,真正的区别在于您需要将CMake生成器设置为“Visual Studio 10 Win64”而不是Visual工作室10.这将给你一个64位的SLN设置,或者只是下载32位库,任一方法都可以。.. :) – tfinniga 2012-09-17 09:54:39
我使用的是VS 2017以及32位pcl可执行文件,它们是从http:/下载的。 /unanancyowen.com/en/pcl18/。我从cmake编译中获得了一个成功的.sln。但是在VS 2017中构建.sln时,我得到了一个未解决的链接错误。可能是什么原因?详细信息也在这里发布 - https: //stackoverflow.com/questions/45300979/viewing-3d-point-cloud-by-integrating-custom-c-api-with-generic-point-cloud-view – 2017-07-27 13:59:37
它看起来像你没有链接PCL库。这可能是因为运行CMake时${PCL_LIBRARIES}
没有适当设置。您可以在find_package
调用后添加
message("PCL_LIBRARIES - ${PCL_LIBRARIES}")
你的CMakeLists.txt文件来检查值。
谢谢你的回答。它看起来像是连接了所有的PCL库(甚至是第三方库)。我将你的行添加到了cmakelists.txt并检查了它。我已经使用Cmake 2.8.7,所以我尝试升级到2.8.8,但没有运气。我得到了与我使用的cmake版本相同的错误:(( – valentin 2012-04-26 14:26:28
我也有同样的问题,我通过手动链接pcl_visualization.lib文件解决。 一个可以尝试以下在Visual C++ 2010的步骤:
项目属性 - >链接器 - >输入 - >附加依赖 - > 添加文件。
在我的情况,我说G:\ PCL \ PCL 1.6.0 \ LIB \ pcl_visualization_release.lib释放和G:\ PCL \ PCL 1.6.0 \ LIB \ pcl_visualization_debug.lib为调试。
它为我工作。
UH!刚刚发生了什么?!?这是一个丑陋而且格式不完整的问题。 – karlphillip 2012-04-26 12:36:18
感谢您指出这一点...希望这是更好的现在:) – valentin 2012-04-26 12:52:52
好吧,我删除了反对票。我建议你降级到以前的版本,然后重试。我看不出您向我们显示的信息有任何错误。 – karlphillip 2012-04-26 13:16:04