MacOS asking for access everytime I build C file on Visual Studio Code

142 Views Asked by At

I'm relatively new to macOS 14.2.1, using Visual Studio Code to write C, I've downloaded "C/C++ Extension", and when I build/run my code using the run button which was created by the extension, MacOS pops up with this message :

"“FILE'S NAME” would like to access files in your Desktop folder"

and each time I have to press Allow

I've tried to open Settings -> Privacy -> Files and Folders/Full Disk Access and give Visual Studio Code permission but that didn't work...

I've also tried to change the file directory to documents and I got the same message but with:

"Documents"

instead of "Desktop".

suppose I try to run the code directly via the terminal (without using the C/C++ Extension run button) by generating .exe file and running it using the commands:

gcc yourfile.c -o youroutputfile

./youroutputfile

in that case, everything will work great and without any messages popping up, but it's frustrating to delete the old .exe file, and then create a new one each time I want to run the code.

Has anyone solved this problem?

Thank you very much! I hope someone will help me here

0

There are 0 best solutions below