I store my codes in a folder called "c", which contains the .vscode folder. The thing is, when I write .c programs in other folders in the "c" folder, they can be automatically compiled and generate .exe files to run by clicking on "run code". But when I create a new folder in the "c" folder and write a .c program there, clicking on ‘run code’ will pop up an interface for me to select the program that compiles the file. If I don’t select it, I find that a compiled file without a suffix appears in the folder, but it is not an executable program. I want to ask what’s going on?
I asked many AI experts, and they suggested that I try to see if it’s a problem with the VSCode itself or the plugin. I disabled some plugins and refreshed VSCode, but none of them worked. Then I tried writing a .c program in another folder and compiling it, successfully compiling and running it. But I still can’t compile in my newly created folder.
2
Answers
I think I found out a very probably reasonable answer! My .c file, its name is contained some "."--dots,like "1.1demo.c" .When I compile the .c file named in this pattern, it failed.However, after many experiments, I find that my vscode works well when compiling some other files, no matter in what folder(so my guess previously is false).And after many combanition, I finally found that if a file contains 2 or more than 2 dot, vscode cannot compile it to a .exe file.But when I delete those dots, only left the dot that in ".c", it compiled successfully. I think that's the answer -- do not use 2 or more than 2 dots in a file!
I think it is a problem with the code runner. Just select gcc or any other compiler in the pop up.