简体   繁体   中英

PCL 1.8.1 Visual Studio 2017 FLANN LNK2019 Linker error build

I am trying to setup PCL 1.8.1 library from https://github.com/PointCloudLibrary/pcl/releases in Visual Studio 2017.

In my Include Directories I have:

C:\\Program Files (x86)\\OpenNI2\\Include
C:\\Program Files (x86)\\PCL 1.8.1\\3rdParty\\VTK\\include\\vtk-8.0
C:\\Program Files (x86)\\PCL 1.9.1\\3rdParty\\Qhull\\include
C:\\Program Files (x86)\\PCL 1.8.1\\3rdParty\\FLANN\\include
C:\\Program Files (x86)\\PCL 1.8.1\\3rdParty\\Eigen\\eigen3
C:\\Program Files (x86)\\PCL 1.8.1\\3rdParty\\Boost\\include\\boost-1_64
C:\\Program Files (x86)\\PCL 1.8.1\\include\\pcl-1.8

Library Directories:

C:\\Program Files (x86)\\PCL 1.8.1\\3rdParty\\VTK\\lib
C:\\Program Files (x86)\\PCL 1.8.1\\3rdParty\\Qhull\\lib
C:\\Program Files (x86)\\PCL 1.8.1\\3rdParty\\FLANN\\lib
C:\\Program Files (x86)\\PCL 1.8.1\\3rdParty\\Boost\\lib
C:\\Program Files (x86)\\PCL 1.8.1\\lib
C:\\Program Files (x86)\\OpenNI2\\Lib

Which I assume is all correct. I am able to build and run a simple example like http://pointclouds.org/documentation/tutorials/writing_pcd.php#writing-pcd . My main need is to use Fdtrees and Octrees, however when I try to compile this example http://pointclouds.org/documentation/tutorials/kdtree_search.php#kdtree-search , I got LNK2019 errors: LNK2019 errors screenshot

As you can see, it is all related to FLANN library. I discovered that even when I delete C:\\Program Files (x86)\\PCL 1.8.1\\3rdParty\\FLANN\\lib from Include Libraries, the same errors occur. Am I not including the library correctly?

Also this post: Setting up Point Cloud Library with Visual Studio mentions adding .libs in Linker/Input/Additional Dependencies. I tried doing that aswell like:

C:\\Program Files (x86)\\PCL 1.8.1\\3rdParty\\FLANN\\lib\\flann.lib
C:\\Program Files (x86)\\PCL 1.8.1\\3rdParty\\FLANN\\lib\\flann_cpp.lib
C:\\Program Files (x86)\\PCL 1.8.1\\3rdParty\\FLANN\\lib\\flann_cpp_s.lib
C:\\Program Files (x86)\\PCL 1.8.1\\3rdParty\\FLANN\\lib\\flann_cpp_s-gd.lib
C:\\Program Files (x86)\\PCL 1.8.1\\3rdParty\\FLANN\\lib\\flann_cpp-gd.lib
C:\\Program Files (x86)\\PCL 1.8.1\\3rdParty\\FLANN\\lib\\flann_s.lib
C:\\Program Files (x86)\\PCL 1.8.1\\3rdParty\\FLANN\\lib\\flann_s-gd.lib
C:\\Program Files (x86)\\PCL 1.8.1\\3rdParty\\FLANN\\lib\\flann-gd.lib

And also without the full paths, but still no success...

I am really trying to make this work and also UNDERSTAND the whole process of including external stuff in Visual Studio / C++. I am quite new to this and it is definitely a more complicated process than Python's "pip install xyz, import xyz"... Bud I hate when something is a black box to me and would really like to get my head around this.

Sorry if this post was too long, but I wanted to provide every detail. THANK YOU for any answer.

I actually managed to solve this! The problem was that I did not hook up "pcl_kdtree_debug.lib", includes for the FLANN library were OK after all. From the linker errors it wast just very unclear what it actually needs. I figured it out while using a totally different library for a different thing which had a similar issue.

Thanks drescherjm! You played your role in this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM