0

我正在尝试使用 Open Point Cloud 库来对齐点云。我使用 Visual Studio 2012 并创建了一个新的 Visual c++ 项目。存储PCL的所有.libs的目录添加到项目的属性中(属性-> c/c++->通用->附加包含目录)我要使用的库列在属性->链接器->输入 -> 附加依赖项

我写到现在的代码很简单:

#include <iostream>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
#include <pcl/point_cloud.h>

int main(int argc, char** argv)
{
    //creates a PointCloud<PointXYZ> boost shared pointer and initializes it
    pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_src (new pcl::PointCloud<pcl::PointXYZ>); 
    //load Pointsclouds from PCD-Files       
    pcl::io::loadPCDFile<pcl::PointXYZ> ("pcd_ascii.pcd", *cloud_src); // <- at this point the error occurs
}

我只是按照本教程: http: //pointclouds.org/documentation/tutorials/reading_pcd.php

我包含了正确的库和文件……尤其是“pcd_io.h”,为什么会出现链接器错误?我要加载的 pcd 文件与 cpp 文件位于同一文件夹中。我是否以错误的方式处理库?

Link-Errors Fehler 28 错误 LNK2020: Nicht aufgel÷stes Token (0A000C90) "void __cdecl pcl::console::print(enum pcl::console::VERBOSITY_LEVEL,char const *,...)" (?print@控制台@pcl@@$$FYAXW4VERBOSITY_LEVEL@12@PBDZZ)。D:\Documents\\Code\PCL_cpp\pcl_cpp\pcl_cpp\pcl_registration.obj pcl_cpp

Fehler 29 错误 LNK2020:Nicht aufgel÷stes 令牌 (0A000CBD) “void __cdecl pcl::console::print(enum pcl::console::VERBOSITY_LEVEL,char const *,...)” (?print@console@pcl@ @$$FYAXW4VERBOSITY_LEVEL@12@PBDZZ)。D:\Documents\代码\PCL_cpp\pcl_cpp\pcl_cpp\pcl_registration.obj pcl_cpp

Fehler 30 错误 LNK2001: Nicht aufgel÷stes externes Symbol ""public: virtual int __thiscall pcl::PCDReader::readHeader(class std::basic_string,class std::allocator > const &,struct sensor_msgs::PointCloud2 &,class Eigen ::Matrix &,class Eigen::Quaternion &,int &,int &,unsigned int &,int)" (?readHeader@PCDReader@pcl@@UAEHABV?$basic_string@DU?$char_traits@D@std@@V ?$allocator@D@2@@std@@AAUPointCloud2@sensor_msgs@@AAV?$Matrix@M$03$00$0A@$03$00@Eigen@@AAV?$Quaternion@M$0A@@8@AAH4AAIH@Z) ”。D:\Documents\代码\PCL_cpp\pcl_cpp\pcl_cpp\pcl_registration.obj pcl_cpp

Fehler 31 错误 LNK2001: Nicht aufgel÷stes externes Symbol ""public: virtual int __thiscall pcl::PCDReader::read(class std::basic_string,class std::allocator > const &,struct sensor_msgs::PointCloud2 &,class Eigen ::Matrix &,class Eigen::Quaternion &,int &,int)" (?read@PCDReader@pcl@@UAEHABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2 @@std@@AAUPointCloud2@sensor_msgs@@AAV?$Matrix@M$03$00$0A@$03$00@Eigen@@AAV?$Quaternion@M$0A@@8@AAHH@Z)"。D:\Documents\代码\PCL_cpp\pcl_cpp\pcl_cpp\pcl_registration.obj pcl_cpp

Fehler 32 错误 LNK2001: Nicht aufgel÷stes externes Symbol ""void __cdecl pcl::console::print(enum pcl::console::VERBOSITY_LEVEL,char const *,...)" (?print@console@pcl@@ $$FYAXW4VERBOSITY_LEVEL@12@PBDZZ)"。D:\Documents\Code\PCL_cpp\pcl_cpp\pcl_cpp\pcl_registration.obj pcl_cpp

错误是德语“Nicht aufgelöstes”的意思是未解决根据您关于正确安装的评论...我不舒尔,所以我再次下载并安装了它。它是 64 位“Windows MSVC 2010(64 位)”的完整安装程序,安装后我得到相同的结果。

4

1 回答 1

0

首先检查所有编译器和库是否具有相同的 32 位或 64 位版本。

您需要从外部链接这些库:

/LIBPATH:"C:\Program Files (x86)\PCL 1.6.0\lib" "pcl_common_debug.lib" "pcl_io_debug.lib"     pcl_common_release.lib" "pcl_features_release.lib" 

您可以将此行添加到您的:

project>properties>commandline
于 2013-04-22T09:51:36.403 回答