c++ - 现实中如何在 Visual Studio 中使用 vcpkg 安装包?

标签 c++ visual-studio vcpkg

写的是here

In Visual Studio, you can create a New Project (or open an existing one). All installed libraries are immediately ready to be #include'd and used in your project without additional configuration.



这在现实中是不正确的。如果我这样做 New Project并从头开始创建控制台或 CMake 应用程序并包含一些 CGAL(因为我在 vgpkg 中安装了 CGAL)我(显然)收到错误消息,说 CGAL包括未找到。

怎么修?可以将 vcpkg 的路径放在 Visual Studio 中的某个地方吗?
vcpkg integrate install也没有帮助。
D:\dev\vcpkg>vcpkg integrate install
Applied user-wide integration for this vcpkg root.

All MSBuild C++ projects can now #include any installed libraries.
Linking will be handled automatically.
Installing new libraries will make them instantly available.

CMake projects should use: "-DCMAKE_TOOLCHAIN_FILE=D:/dev/vcpkg/scripts/buildsystems/vcpkg.cmake"

它声称它会起作用,但它没有

enter image description here

而且很明显,因为世界上没有魔法。

那么,我忘记了“没有额外配置”还有什么?

最佳答案

这是一个“三元组”问题(设置为 x86 而不是 x64)。麻烦各位了 :)

关于c++ - 现实中如何在 Visual Studio 中使用 vcpkg 安装包?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59865669/

相关文章:

android - QML 加载,找不到文件

c++ - 如何在 C++ (MSVS) 中获取自纪元以来的本地当前时间(以秒为单位)?

c# - Delphi 到 C# - 任何像样的工具来做一些硬核转换?

visual-studio - __CxxFrameHandler4 是什么,链接器错误 "unresolved external symbol __CxxFrameHandler4"究竟是什么意思?

VCPKG:列出包的可用版本

c++ - 如何修复 'Vcpkg/CMake Is Unable to determine target architecture'(Windows10、vcpkg、clion、cmake)

c++ - 字符 - 'pub' 在 std::streambuf::pubsetbuf() 方法中意味着什么?

c++ - 在 C++ 中添加指向字符串的指针

c++ - 如何显示字符串中多次出现的字符?

visual-studio - 在 Web 部署之后运行部署后脚本