繁体   English   中英

安装点云库

[英]Install Point Cloud Library

我最近被介绍给vcpkg,因为我一直在寻找安装点云库(PCL)的最佳方法,以便在我的Visual Studio C ++项目中使用它。

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

我创建了一个原始项目,并完成了以下操作以添加PCL:

  • 在属性页-> VC ++目录->包含目录中添加了“ vcpkg-master \\ installed \\ x64-windows-static \\ include”路径
  • 向属性页添加了“ vcpkg-master \\ installed \\ x64-windows-static \\ include”路径
    -> C / C ++->其他包含目录
  • 将所有库文件(vcpkg-master \\ installed \\ x64-windows-static \\ lib中的文件)添加到属性页->链接器->其他依赖项
  • 将“ vcpkg-master \\ installed \\ x64-windows-static \\ lib”路径添加到属性页->链接器->常规->其他库目录

我正在尝试在Debug x86模式下编译前面提到的演示,但我不断收到以下错误:

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

请注意,在已安装的PCL目录中,有两个名为manual-link的文件夹。
第一个是“ vcpkg-master \\ installed \\ x64-windows-static \\ debug \\ lib \\ manual-link”,其中包含两个lib文件:

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

另一个是“ vcpkg-master \\ installed \\ x64-windows-static \\ lib \\ manual-link”,包括:

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

我不知道我在这里想念什么。 有没有人遇到过PCL和Visual Studio 2017相同的问题? 这个问题有解决方案吗?

不会自动选择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>

请注意,如果这样做,您还需要将CRT(/ MT)更改为静态链接。

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

无论哪种方式,您都无需向“其他包含目录”或“其他依赖项”添加任何路径。

[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