System opening multiple MS Visial Stuios when compiling

As the title suggests, when I use the command prompt to open VS (using ‘CODE’) when I command the program to compile (*.CPP) instead of just compiling as it used to do, it forces my code to open in MS Visual Studio. Not sure why and have no idea how to fix it.

Anyone?

You didn’t use the compiler. Typing

filename

opens that file in the default application for that file extension. It has the same effect as double clicking it in File Explorer.


cl is the command line compiler and you give it files to compile (along with any options)

cl triplex.cpp

Will tell the compiler to compile triplex.cpp and output an executable of the same name i.e. “triplex.exe”. You would then type that to execute the program

triplex.exe

you can omit “.exe” and it’ll mean the same thing.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms