致命错误:“SDL.h”在 MAC 上找不到文件

发布于 2025-01-18 10:12:33 字数 1199 浏览 0 评论 0原文

我尝试编译代码,但出现错误。

In file included from ui.c:1:
./ui.h:3:10: fatal error: 'SDL.h' file not found
#include <SDL.h>
     ^~~~~~~
1 error generated.

但我已经在我的Mac上安装了SDL库并在VScode上设置了includePath。 这是我的 cpp_properties.json 的设置

{
"configurations": [
    {
        "name": "Mac",
        "includePath": [
            "${workspaceFolder}/**",
            "/Users/kimdongju/Dungeonrush/src/**",
            "/usr/local/Cellar/sdl/1.2.15_3/include/SDL/**",
            "/usr/local/Cellar/sdl2/2.0.20/include/SDL2/**",
            "/usr/local/Cellar/sdl2_image/2.0.5/include/SDL2/**",
            "/usr/local/Cellar/sdl2_mixer/2.0.4_3/include/SDL2/**",
            "/usr/local/Cellar/sdl2_net/2.0.1/include/SDL2/**",
            "/usr/local/Cellar/sdl2_ttf/2.0.18_1/include/SDL2/**"
        ],
        "defines": [],
        "macFrameworkPath": [
            
            "/Library/Developer/CommandLineTools/SDKs
            /MacOSX.sdk/System/Library/Frameworks"
        ],
        "compilerPath": "/usr/bin/clang",
        "cStandard": "c17",
        "cppStandard": "c++98",
        "intelliSenseMode": "macos-clang-x64"
    }
],
"version": 4
}

I tried to compile codes and i have an error.

In file included from ui.c:1:
./ui.h:3:10: fatal error: 'SDL.h' file not found
#include <SDL.h>
     ^~~~~~~
1 error generated.

but i've already installed SDL library on my mac and set includePath on VScode.
here is a setting of my cpp_properties.json

{
"configurations": [
    {
        "name": "Mac",
        "includePath": [
            "${workspaceFolder}/**",
            "/Users/kimdongju/Dungeonrush/src/**",
            "/usr/local/Cellar/sdl/1.2.15_3/include/SDL/**",
            "/usr/local/Cellar/sdl2/2.0.20/include/SDL2/**",
            "/usr/local/Cellar/sdl2_image/2.0.5/include/SDL2/**",
            "/usr/local/Cellar/sdl2_mixer/2.0.4_3/include/SDL2/**",
            "/usr/local/Cellar/sdl2_net/2.0.1/include/SDL2/**",
            "/usr/local/Cellar/sdl2_ttf/2.0.18_1/include/SDL2/**"
        ],
        "defines": [],
        "macFrameworkPath": [
            
            "/Library/Developer/CommandLineTools/SDKs
            /MacOSX.sdk/System/Library/Frameworks"
        ],
        "compilerPath": "/usr/bin/clang",
        "cStandard": "c17",
        "cppStandard": "c++98",
        "intelliSenseMode": "macos-clang-x64"
    }
],
"version": 4
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文