c++ - 如何在 macOS VS Code 上正确配置 vcpkg C++ includePath?
问题描述
我用 Homebrew 安装了 vcpkg。我按照官方 vcpkg 文档的说明进行操作。
我使用了这个命令:
vcpkg integrate project
并收到以下消息:
Applied user-wide integration for this vcpkg root.
CMake projects should use: "-DCMAKE_TOOLCHAIN_FILE=/usr/local/Cellar/vcpkg/2020.11-1/libexec/scripts/buildsystems/vcpkg.cmake"
我添加到 VS Code settings.json
"cmake.configureSettings": {
"CMAKE_TOOLCHAIN_FILE": "/usr/local/Cellar/vcpkg/2020.11-1/libexec/scripts/buildsystems/vcpkg.cmake"
}
和 c_cpp_properties.json includePath:
"/usr/local/Cellar/vcpkg/2020.11-1/libexec/packages/**"
或者:
"/usr/local/Cellar/vcpkg/2020.11-1/libexec/packages"
并且 VS Code 仍然找不到任何 vcpkg 库。我有错误:
#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (/Users/emilmordarski/Uczelnia/PG/teams/freeglut3.cpp).C/C++(1696)
cannot open source file "freeglut/include/GL/glut.h"C/C++(1696)
我使用的是 macOS Big Sur 11.1。我已经安装了 C/C++、Cmake 和其他一些扩展来支持 VS Code 中的 C++。
我也试过 install vcpkg cloning git repo,但效果是一样的。有任何想法吗?
解决方案
推荐阅读
- c# - 如何在 ajax asp.net mvc 中用数据(其数据库值)填充文本框?
- java - 如何在Android中停止消费广播?
- c++ - 如何创建辅助数据结构以跟踪 minheap 中的堆索引以用于 c++ 中的 reduce_key 操作
- mysql - SQL - Triple nested while insert
- twitter-bootstrap-3 - 我使用的这段代码不是移动响应的
- android - 如何获得对受限 android 目录的读/写访问权限(比如 /data/data/
/)? - angularjs - 无法在 asp.net mvc 中显示来自 s3 存储桶的上传图像
- css - 表格尺寸最小
- php - php codeigniter文本水印不来
- javascript - 用链接替换主题标签,它只替换字符串中的最后一个单词