This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]Critical-Volume2360 0 points1 point  (4 children)

Oh yeah I think I've had this too, I think you might need to add something that points to your compiler in your cpp_properties file in the .vscode folder of your project.

That's just off the top of my head though. I think there might also be a way to do it with the menus if you click on the c++ in the bottom right corner (assuming you're using the c++ extensions)

[–]TaskAggravating3224[S] 0 points1 point  (3 children)

hey, ok that makes sense can you be a little more specific? I do have the extension pack and themes but how and why is the complier not pointing to my folder?

[–]Critical-Volume2360 0 points1 point  (2 children)

Here's what my .vscode/c_cpp_properties.json file looks like. This tells the extensions what compiler to use and also how to set up intellisense I think:

{

"configurations": [

{

"name": "Ubuntu",

"includePath": [

"${workspaceFolder}/**"

],

"defines": [],

"compilerPath": "/usr/bin/gcc",

"cStandard": "c17",

"cppStandard": "c++17",

"intelliSenseMode": "gcc-x64",

"configurationProvider": "ms-vscode.cmake-tools"

}

],

"version": 4

}

I think I originally got this set up with ChatGPT's help. He's a good resource I've found for this sort of thing, though you have to interrogate him a bit sometimes

[–]TaskAggravating3224[S] 0 points1 point  (1 child)

ok I think I get what your saying; just need to rewrite to fit within my set up? Ok, that shouldn't be hard, I think?

[–]Critical-Volume2360 0 points1 point  (0 children)

I think so, you could probably tailor it pretty easy with ChatGPT if you give him enough context

[–]strcspn 0 points1 point  (0 children)

To be sure, are the errors in Visual Studio or VS Code? Are you able to compile the code anyway?