c_cpp_properties.json:
Код: Выделить всё
{
"version": 4,
"configurations": [
{
"name": "macOS-Clang",
"includePath": [
"${workspaceFolder}/**",
"/opt/homebrew/include"
],
"browse": {
"path": [
"${workspaceFolder}/**",
"/opt/homebrew/include"
],
"limitSymbolsToIncludedHeaders": true
},
"defines": [],
"macFrameworkPath": [
"/System/Library/Frameworks",
"/Library/Frameworks"
],
"compilerPath": "/usr/bin/clang++",
"cStandard": "c17",
"cppStandard": "c++20",
"intelliSenseMode": "macos-clang-arm64"
}
]
}
Код: Выделить всё
{
"version": "0.2.0",
"configurations": [
{
"name": "(lldb) Launch SDL2",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [
{
"name": "DYLD_LIBRARY_PATH",
"value": "/opt/homebrew/lib"
}
],
"externalConsole": true,
"MIMode": "lldb"
}
]
}
Код: Выделить всё
{
"version": "2.0.0",
"tasks": [
{
"label": "Build with SDL2",
"type": "shell",
"command": "/bin/zsh",
"args": [
"-c",
"clang++ -std=gnu++20 -Wall -Wextra -Wpedantic -g \"${file}\" $(sdl2-config --cflags --libs) -o \"${fileDirname}/${fileBasenameNoExtension}\""
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": false
}
},
{
"type": "cppbuild",
"label": "C/C++: clang++ build active file",
"command": "/usr/bin/clang++",
"args": [
"-fcolor-diagnostics",
"-fansi-escape-codes",
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "Task generated by Debugger."
}
]
}
Код: Выделить всё
#include
#include
int main() {
if (SDL_Init(SDL_INIT_VIDEO) != 0) {
std::cerr
Подробнее здесь: [url]https://stackoverflow.com/questions/79866548/sdl2-sdl-h-file-not-found-when-trying-to-run-script-on-macos-vscode[/url]