安装点云库
Install Point Cloud Library
我最近被介绍给vcpkg,因为我一直在寻找安装点云库(PCL)的最佳方法,以便在我的Visual Studio C++项目中使用它。
我已经使用.vcpkg install pcl:x64-windows-static
安装了PLC静态库,然后.vcpkg integrate install
将库和dll集成到Visual Studio 2017中。我现在的目标是在 PCL 官方网站上运行迭代最近点算法的演示。
我创建了一个原始项目,并执行以下操作来添加PCL:
- 添加了"vcpkg-master\installed\x64-windows-static\include"路径到属性页->VC++目录->包含目录
- 将"vcpkg-master\installed\x64-windows-static\include"路径添加到属性页
->C/C++ ->其他包含目录 - 添加了所有库文件(vcpkg-master\installed\x64-windows-static\lib 中的文件)到属性页>链接器->其他依赖项
- 添加了"vcpkg-master\installed\x64-windows-static\lib"路径到属性页>链接器->常规->其他库目录
我正在尝试在调试x86模式下编译前面提到的演示,但不断收到以下错误:
1>LINK : fatal error LNK1104: cannot open file 'manual-link.obj'
请注意,在已安装的 PCL 目录中,有两个文件夹称为手动链接。
第一个是"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
- 在Ubuntu 16.04上安装Cilk时出现问题
- 在CMakeLists.txt的安装功能中使用.cmake文件有什么用
- C++:如何在CLion IDE中安装Boost
- 安装opencv失败-粘贴CMakeError.log的内容
- 在cygwin中测试新的boost安装时出现cpp错误
- 有人安装"IITB Simplecpp in mac"吗?
- 我可以在 Arduino 的库文件夹之外安装库吗?
- Mingw-64 在构建和安装后不会编译 openCV 代码
- 为什么构建目录中新构建的共享库与安装目录中的副本具有不同的依赖项集?
- 安装 libc++ 时出现问题
- 安装MinGW后C++编译器不起作用?
- 介子复制/安装头文件到输出目录并保持文件夹结构
- 无法安装 R 包 "nloptr"(Ubuntu 16.04 上的 R3.6.2) - C++编译器问题
- 如何在 Ubuntu 上安装 OpenCV for C/C++
- 检查是否安装了 windows10 C++
- 安装 psutil 和为 pypy 配置期间出错
- 如何在 Debian 10 上安装 CPP 手册页?
- 如何更改使用 CPack 安装的可执行文件的名称?
- 使用 MinGW 在 Windows 上安装 GMP 时出错
- 在 macOS 上安装 clang_complete