Hi, I am trying to move to Cursor IDE from VSCode. I am on a mac, so the default c++ is clang, but I have installed gcc/g+±14. This works fine in VSCode: it both compiles and the intellisense is g++. In Cursor, while using gcc specific things (such as gnu PBDS), it compiles fine, but the intellisense marks it as red squiggles. The intellisense is set to macos-gcc-arm64.
c_cpp_properties.json:
{
"configurations": [
{
"name": "Mac",
"includePath": [
"/opt/homebrew/Cellar/gcc/14.2.0_1/include/c++/14",
"/opt/homebrew/Cellar/gcc/14.2.0_1/include/c++/14/aarch64-apple-darwin24",
"/opt/homebrew/Cellar/gcc/14.2.0_1/include/c++/14/backward",
"/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include"
],
"defines": [],
"compilerPath": "/opt/homebrew/Cellar/gcc/14.2.0_1/bin/g++-14",
"cStandard": "c11",
"cppStandard": "c++14",
"intelliSenseMode": "macos-gcc-arm64"
}
],
"version": 4
}
settings.json:
{
"github.copilot.enable": {
"*": true,
"plaintext": false,
"markdown": false,
"scminput": false
},
"files.associations": {
"unordered_set": "cpp"
}
}
tasks.json:
{
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: g++ build active file",
"command": "/opt/homebrew/Cellar/gcc/14.2.0_1/bin/g++-14",
"args": [
"-fdiagnostics-color=always",
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "Task generated by Debugger."
}
],
"version": "2.0.0"
}
These all work flawlessly in VSCode.
Thanks in advance!
ETA:
For example, an error it gives is:
[{
"resource": "/Users/**********/Documents/VSCODE/temp/temp.cpp",
"owner": "_generated_diagnostic_collection_name_#0",
"code": "pp_file_not_found",
"severity": 8,
"message": "'bits/stdc++.h' file not found",
"source": "clang",
"startLineNumber": 1,
"startColumn": 10,
"endLineNumber": 1,
"endColumn": 25,
"modelVersionId": 1
}]
which is odd since it shouldn’t be clang… How to fix this?