首页 文章

链接错误LNK2020和2001 VSX中的Visual C与PCL库

提问于
浏览
0

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

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

#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 Token(0A000CBD)“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

Fehler 30错误LNK2001:Nicht aufgel÷stes externes符号“”public:virtual int __thiscall pcl :: PCDReader :: readHeader(class std :: basic_string,class std :: allocator> const&,struct sensor_msgs :: PointCloud2&,class Eigen :: Matrix&,类Eigen :: Quaternion&,int&,int&,unsigned int&,int)“(?readHeader @ PCDReader @ pcl @@ UAEHABV?$ basic_string @ DU?$ char_traits @ D @ std @@ V ?$分配器@ d @ @@ 2 STD @@ @ AAUPointCloud2 @@ sensor_msgs AAV?$矩阵@ M $ $版本03 $ 00 0A @ $ $版本03 00 @ @@本征AAV?$ @四元数M $ 0A @@ @ 8 @ AAH4AAIH Z) ” . D:\ Documents \ Code \ PCL_cpp \ pcl_cpp \ pcl_cpp \ pcl_registration.obj pcl_cpp

Fehler 31错误LNK2001:Nicht aufgel÷stes externes符号“”public:virtual int __thiscall pcl :: PCDReader :: read(class std :: basic_string,class std :: allocator> const&,struct sensor_msgs :: PointCloud2&,class Eigen :: Matrix&,类Eigen :: Quaternion&,int&,int)“(?阅读@ PCDReader @ pcl @@ UAEHABV?$ basic_string @ DU?$ char_traits @ D @ std @@ V?$ allocator @ D @ 2 @@ STD @@ AAUPointCloud2 @ sensor_msgs @@ AAV?$基质@ M $ 03 $ $ 00 0A @ $ 03 $ 00 @艾根@@ AAV?$ @四元数M $ 0A @@ 8 @啊哈@ Z)” . D:\ Documents \ Code \ PCL_cpp \ pcl_cpp \ pcl_cpp \ pcl_registration.obj pcl_cpp

Fehler 32错误LNK2001:Nicht aufgel÷stes externes符号“”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

错误在德语中“Nichtaufgelöstes”意味着未解决关于正确安装的问题...我不是真的,所以我下载并再次安装它 . 它是64位“Windows MSVC 2010(64位)”的完整安装程序“安装后我得到了相同的结果 .

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
    

相关问题