VS2012 中的链路错误LNK2020和 2001 Visual C++ with PCL-Libraries



我正在尝试使用Open Point Cloud库来对齐点云。我使用Visual Studio 2012创建了一个新的Visual c++项目。存储PCL的所有.lib的目录被添加到项目的属性中(properties -> c/c++ -> general-> additional include Directory)我想使用的库列在Properties -> linker -> Input -> additional dependencies

我现在写的代码很简单:

#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文件位于与pcp文件相同的文件夹中。我是否用了错误的方式处理这些文件?

链接错误Fehler 28错误LNK2020: night aufgel÷stes Token (0A000C90)"void __cdecl pcl::console::print(enum pcl::console::VERBOSITY_LEVEL,char const *,…)"(? print@console@pcl@@ $ $ FYAXW4VERBOSITY_LEVEL@12@PBDZZ)。D: 文件代码 PCL_cpp PCL_cpp PCL_cpp pcl_registration。obj pcl_cpp

Fehler 29错误LNK2020: night aufgel÷stes Token (0A000CBD)"void __cdecl pcl::console::print(enum pcl::console::VERBOSITY_LEVEL,char const *,…)"(? print@console@pcl@@ $ $ FYAXW4VERBOSITY_LEVEL@12@PBDZZ)。D: 文件代码 PCL_cpp PCL_cpp PCL_cpp pcl_registration。obj pcl_cpp

Fehler 30错误LNK2001:夜aufgel÷stes外部符号"public: virtual int __thiscall pcl::PCDReader::readHeader(类std::basic_string,类std::allocator> const &,struct sensor_msgs::PointCloud2 &,类Eigen::矩阵&,类Eigen::四元数&,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 0美元a@ 03 00美元@eigen@@aav ? Quaternion@M美元0 a@@8@aah4aaih@z)"。D: 文件代码 PCL_cpp PCL_cpp PCL_cpp pcl_registration。obj pcl_cpp

Fehler 31错误LNK2001:夜aufgel÷stes外部符号"public: virtual int __thiscall pcl::PCDReader::read(类std::basic_string,类std::allocator> const &,struct sensor_msgs::PointCloud2 &,类Eigen::矩阵&,类Eigen::四元数&,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 0美元a@ 03 00美元@eigen@@aav ? Quaternion@M美元0 a@@8@aahh@z)"。D: 文件代码 PCL_cpp PCL_cpp PCL_cpp pcl_registration。obj pcl_cpp

Fehler 32错误LNK2001:夜aufgel÷stes外部符号"void __cdecl pcl::console::print(enum pcl::console::VERBOSITY_LEVEL,char const *,…)"(? print@console@pcl@@ $ $ FYAXW4VERBOSITY_LEVEL@12@PBDZZ)"。D: 文件代码 PCL_cpp PCL_cpp PCL_cpp pcl_registration。obj pcl_cpp

错误是德语" night aufgelöstes"的意思是无法解决关于你关于正确安装的评论…我不在,所以我下载并重新安装了它。"Windows MSVC 2010(64位)"的完整安装程序安装后,我得到相同的结果。

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

你需要外部链接这些库:

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

你可以把这行添加到你的:

project>properties>commandline

最新更新