简体   繁体   中英

Install Point Cloud Library

I've recently been introduced to vcpkg as I've been looking for the best way to install Point Cloud Library (PCL) in order to use it in my Visual Studio C++ project.

I've installed PLC static libraries using .\\vcpkg install pcl:x64-windows-static and then .\\vcpkg integrate install to integrate the libs and dlls to Visual Studio 2017. My goal for now is to run the demo of Iterative Closest Point Algorithm on the official PCL website.

I have created a virgin project and I've done the following to add PCL:

  • Added "vcpkg-master\\installed\\x64-windows-static\\include" path to Property Page->VC++ directories->Include Directories
  • Added "vcpkg-master\\installed\\x64-windows-static\\include" path to Property Page
    ->C/C++ ->Additional Include Directories
  • Added the all the lib files (the ones in vcpkg-master\\installed\\x64-windows-static\\lib)to Property Page->Linker->Additional Dependencies
  • Added "vcpkg-master\\installed\\x64-windows-static\\lib" path to Property Page->Linker->General->Additional Library Directories

I'm trying to compile the previously mentioned demo in Debug x86 mode but I keep getting the following error:

1>LINK : fatal error LNK1104: cannot open file 'manual-link.obj'

Please note that in the installed PCL directories, there are two folders called manual-link .
The first one is "vcpkg-master\\installed\\x64-windows-static\\debug\\lib\\manual-link" and contains two lib files:

  • boost_prg_exec_monitor-vc140-mt-gd.lib
  • boost_test_exec_monitor-vc140-mt-gd.lib

The other one is "vcpkg-master\\installed\\x64-windows-static\\lib\\manual-link" and includes:

  • boost_prg_exec_monitor-vc140-mt.lib
  • boost_test_exec_monitor-vc140-mt.lib

I don't know what I'm missing here. Has anybody experienced the same problem with PCL and Visual Studio 2017? Any solutions to this problem?

The x64-windows-static triplets won't be automatically selected[1] -- you need to edit your MSBuild vcxproj and set the VcpkgTriplet MSBuild property to x64-windows-static :

<PropertyGroup Label="Globals">
  <!-- .... -->
  <VcpkgTriplet Condition="'$(Platform)'=='Win32'">x86-windows-static</VcpkgTriplet>
  <VcpkgTriplet Condition="'$(Platform)'=='x64'">x64-windows-static</VcpkgTriplet>
</PropertyGroup>

Note that you will also need to change to static link the CRT (/MT) if you do this.

Alternatively, you can install the dynamic libraries ( x64-windows ) and they will be automatically picked up by default and work with the settings for your new project without any changes.

Either way, you should not need to add any paths to your Additional Include Directories or to your Additional Dependencies.

[1] https://github.com/Microsoft/vcpkg/blob/master/docs/users/integration.md#triplet-selection

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