微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Visual Studio Code 似乎不尊重 includePath

如何解决Visual Studio Code 似乎不尊重 includePath

我有一个使用 glm 的 C++ 项目——一个模仿 GLSL 的只有头文件的数学库。我试图按照 C/C++ 扩展设置的指示,通过编辑 c_cpp_properties.json 文件来让 Visual Studio Code 搜索包含文件。这是文件内容

{
    "configurations": [
        {
            "name": "Win32","includePath": [
                "${default}","C:/Users/esmith-rowland/sources/glm"
            ],"defines": [
                "_DEBUG","UNICODE","_UNICODE"
            ],"windowsSdkVersion": "10.0.19041.0","compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29910/bin/Hostx64/x64/cl.exe","cStandard": "c17","cppStandard": "c++17","intelliSenseMode": "windows-msvc-x64","configurationProvider": "ms-vscode.cmake-tools"
        }
    ],"version": 4
}

尽管如此,我还是得到了波浪线:

#ifdef __cplusplus
#include <glm/glm.hpp>
using namespace glm;

带有消息:

Cannot open include file: 'glm/glm.hpp': No such file or directory [C:\Users\esmith-rowland\vipre-core\build\utd\plot\utd_plot_reflection_coefficient.vcxproj]

和构建窗口中的消息,例如: 无法打开包含文件:'glm/glm.hpp':没有那个文件或目录 [C:\Users\esmith-rowland\vipre-core\build\utd\plot\utd_plot_reflection_coefficient.vcxproj]

我已验证提供的目录下是否存在 glm/glm.hpp。 我错过了什么?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。