当我试图导入GLFW时,我在VSCode中得到一个错误,上面写着“致命错误: GLFW/glfw3.h:没有这样的文件或目录”。我读了一些关于这个错误的文章,但不明白如何解决这个问题。谢谢你的帮助!
项目结构:
src/
main.c
lib/
GLFW/
include/
GLFW/
glfw3.h
glfw3.lib以下是我的主要代码:
#include <stdio.h>
#include <GLFW/glfw3.h> // fatal error: GLFW/glfw3.h: No such file or directory
int main() {
printf("Hello, World!");
return 0;
}c_cpp_properties.json:
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}\\src\\**",
"${workspaceFolder}\\lib\\**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "10.0.19041.0",
"compilerPath": "C:\\MinGW\\bin\\gcc.exe",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "windows-gcc-x64"
}
],
"version": 4
}tasks.json
{
"version": "2.0.0",
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: gcc.exe build active file",
"command": "C:\\MinGW\\bin\\gcc.exe",
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe",
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "compiler: C:\\MinGW\\bin\\gcc.exe"
}
]
}发布于 2022-04-18 08:48:39
c_cpp_properties.json
"forcedInclude": [
"C:/VulkanSDK/1.3.204.1/Include/vulkan/vulkan.h",
"C:/glfw-3.3.6.bin.WIN64/include/GLFW/glfw3.h"
]
"includePath": [
"${workspaceFolder}/include",
"C:/VulkanSDK/1.3.204.1/Include/**",
"C:/glfw-3.3.6.bin.WIN64/include/**",
"C:/glm"
]https://stackoverflow.com/questions/69479131
复制相似问题