简体   繁体   English

安装点云库

[英]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. 我最近被介绍给vcpkg,因为我一直在寻找安装点云库(PCL)的最佳方法,以便在我的Visual Studio C ++项目中使用它。

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. 我已使用.\\vcpkg install pcl:x64-windows-static安装了PLC静态库,然后使用.\\vcpkg integrate install将库和dll集成到Visual Studio2017。我现在的目标是运行迭代最近点演示在PCL官方网站上的算法

I have created a virgin project and I've done the following to add PCL: 我创建了一个原始项目,并完成了以下操作以添加PCL:

  • Added "vcpkg-master\\installed\\x64-windows-static\\include" path to Property Page->VC++ directories->Include Directories 在属性页-> VC ++目录->包含目录中添加了“ vcpkg-master \\ installed \\ x64-windows-static \\ include”路径
  • Added "vcpkg-master\\installed\\x64-windows-static\\include" path to Property Page 向属性页添加了“ vcpkg-master \\ installed \\ x64-windows-static \\ include”路径
    ->C/C++ ->Additional Include Directories -> C / C ++->其他包含目录
  • Added the all the lib files (the ones in vcpkg-master\\installed\\x64-windows-static\\lib)to Property Page->Linker->Additional Dependencies 将所有库文件(vcpkg-master \\ installed \\ x64-windows-static \\ lib中的文件)添加到属性页->链接器->其他依赖项
  • Added "vcpkg-master\\installed\\x64-windows-static\\lib" path to Property Page->Linker->General->Additional Library Directories 将“ vcpkg-master \\ installed \\ x64-windows-static \\ lib”路径添加到属性页->链接器->常规->其他库目录

I'm trying to compile the previously mentioned demo in Debug x86 mode but I keep getting the following error: 我正在尝试在Debug x86模式下编译前面提到的演示,但我不断收到以下错误:

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 . 请注意,在已安装的PCL目录中,有两个名为manual-link的文件夹。
The first one is "vcpkg-master\\installed\\x64-windows-static\\debug\\lib\\manual-link" and contains two lib files: 第一个是“ vcpkg-master \\ installed \\ x64-windows-static \\ debug \\ lib \\ manual-link”,其中包含两个lib文件:

  • boost_prg_exec_monitor-vc140-mt-gd.lib boost_prg_exec_monitor-vc140-mt-gd.lib
  • boost_test_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: 另一个是“ vcpkg-master \\ installed \\ x64-windows-static \\ lib \\ manual-link”,包括:

  • boost_prg_exec_monitor-vc140-mt.lib boost_prg_exec_monitor-vc140-mt.lib
  • boost_test_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? 有没有人遇到过PCL和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 : 不会自动选择x64-windows-static三胞胎[1]-您需要编辑MSBuild vcxproj并将VcpkgTriplet MSBuild属性设置为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. 请注意,如果这样做,您还需要将CRT(/ MT)更改为静态链接。

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. 或者,您可以安装动态库( x64-windows ),默认情况下将自动选择它们,并使用新项目的设置而不进行任何更改。

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 [1] https://github.com/Microsoft/vcpkg/blob/master/docs/users/integration.md#triplet-selection

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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