I am a beginner in C++ and I am interested in using the MSVP compiler for compiling my code as well as Visual Studio Code. I am facing a problem with the configuration of the MSVP compiler with VS Code.
I have read the article about the configuration given at this link-https://code.visualstudio.com/docs/cpp/config-msvc. I have configured the compiler and everything works fine. According to the article, each and every project I make requires this configuration, which needs to be copied and pasted in the .vscode folder of every project I make. But, I am not interested in doing this. I want that each project or I make should automatically take up this configuration.
I tried figuring out this problem on my own by putting two or three code files in the folder named helloworld because then all these files would take the same configuration and would get debugged separately, but the main problem is created by this part of the tasks.json file:
"args": [
"/EHsc",
"/Zi",
"/Fe:",
"helloworld.exe",
"helloworld.cpp"
]
This part tells the compiler that the code file HAS to be helloworld.cpp and the executable has to be named helloworld.exe.
In the end, I would like to tell that I want VS Code to be configured like the Visual Studio IDE, where you just type the code by creating a project and the executable gets named just like the code file. For example, the executable of hello.cpp is named hello.exe, and one doesn't need to copy and paste any configuration file anywhere. Also, I would like to tell that I HAVE to use VS Code only. Any help would be appreciated.
Thank you !