Open Visual C ++ with arguments to compile

0

I'm starting with the visual C ++ and I have a project where it is necessary to visual c ++ compile the program automatically. so I thought of arguments like we can use at the normal prompt like:

cmd /k cd c:/Windows

But I have not figured out how to do this since the visual c ++ is a shortcut that already uses this preargument / k. %comspec% /k ""C:\Program Files (x86)\Microsoft Visual C++ Build Tools\vcbuildtools.bat"" amd64_arm

I also thought about making a .bat script to open the c ++ visual and compile.

%comspec% /k ""C:\Program Files (x86)\Microsoft Visual C++ Build Tools\vcbuildtools.bat"" amd64_arm;
cd C:\Users\Huron\Desktop\Injector\RandoInjector;
cl main.cpp;

And it works just to open the visual c ++.

So I'm in this impasse does anyone have any idea how to do this?

    
asked by anonymous 25.01.2018 / 05:54

1 answer

-1

You can use cl.exe which is the Visual Studio command-line compiler. You do not even need Visual Studio, you could just use build tools that would already do that.

The first step is to open the console using one of the shortcuts that remain in Visual Studio in the start menu, there you will find options of 32 and 64 bits.

One tool you may consider using since you are wanting to compile out of VS is to use CMake.

    
25.01.2018 / 09:46