c - 致命错误:GLFW/glfw3.h:没有这样的文件或目录
问题描述
当我尝试导入 GLFW 时,我在 VSCode 中收到错误消息“致命错误:GLFW/glfw3.h:没有这样的文件或目录”。我阅读了一些有关此错误的文章,但不明白如何解决此问题。谢谢您的帮助!
项目结构:
src/
main.c
lib/
GLFW/
include/
GLFW/
glfw3.h
glfw3.lib
这是我的 main.c 代码:
#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
}
任务.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"
}
]
}
解决方案
推荐阅读
- sql-server - ssis中整个过程中带有日期的静态文件名
- python - Django,删除父对象时如何不删除相关对象(与forignkey相关)
- c# - 存储过程到 linq - 特定的 SP
- java - gson:忽略内部 json
- javascript - 部署代码后Heroku应用程序错误?
- android - 未调用 onOptionsItemSelected,因此我无法转到下一页意图
- graphql - 在 GraphQL 中对结果进行分组
- angular - 我在哪里可以找到我导入的包/模块的完整路径?角度 9
- python - 如何规范化 TensorFlow 的“数据集”管道?
- maven - Maven surefire插件skipAfterFailureCount配置不起作用