0
votes

I´m trying to use the Open Point Cloud library for aligning point-clouds. I use Visual Studio 2012 and created a new Visual c++ project. The Directory where all the .libs of PCL are stored is added in the properties of the project (Properties -> c/c++ -> general-> additional include directory) The libs i want to use are listed in Properties -> linker -> Input -> additional dependencies

The Code i Have written till now is very simple:

#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
}

I just followed this tutorial: http://pointclouds.org/documentation/tutorials/reading_pcd.php

I includet the right libs and files…especially “pcd_io.h”, why do I get the linker-error? The pcd-file which I want to load is located in the same folder as the cpp-file. Do I handle the libs in a wrong way?

The Link-Errors Fehler 28 error LNK2020: Nicht aufgel÷stes Token (0A000C90) "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 29 error 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 error 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\ Code\PCL_cpp\pcl_cpp\pcl_cpp\pcl_registration.obj pcl_cpp

Fehler 31 error 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\ Code\PCL_cpp\pcl_cpp\pcl_cpp\pcl_registration.obj pcl_cpp

Fehler 32 error 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

The Errors are in german "Nicht aufgelöstes" means unresolved On your coment regarding the right installation... i wasn´t shure, so i downloaded and installed it again. its the full-installer for 64bit "Windows MSVC 2010 (64bit)" After the Installation i get the same results.

1
are you using the correct PCL installation for your architecture(x86/x64)?Benjamin Trent
Don't make us guess at the linker errors. They were meant to help diagnose the problem. We can't do that if we can't see them.Hans Passant
Sorry, I have forgotten do add them to the description. Thank you for your quick responseChris Mierke
The PCL header files folder should be included in (Properties->VC++ Directories->Include Directories) and the library files folder should be included in (Properties->VC++ Directories->Library Directories). Are you doing this already? It is not very clear from your description.Sassa
Thank you! Your last hint --> Properties-->VC solved the Linker-ErrorChris Mierke

1 Answers

0
votes

First check that all of your compiler and libraries have the same version 32bit or 64bit.

You need to link externally these libraries:

/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" 

you can add this line to your:

project>properties>commandline