I am wondering if anyone here can help me. I have Visual Studio 08 but I prefer to use the MinGW compiler for small practice applications. The way I have been doing this is primitive so far: I open cmd.exe, cd to the place where I keep my source files, then type in "C:\Program Files\MinGW\bin\c++.exe" followed by the name of the source file and "-o " with a name after.
This is a hassle, and I want to know if there is a way to accomplish this using a batch file, BUT I want it to ask for the name of the source file and the name of the final executable, so that I don't have to manually edit the batch file each time I want to use it. Is this even possible?
A made a simple one that goes as follows:
cd c:\users\Brian\Documents\Programming
"c:\Program Files\MinGW\bin\c++.exe" hello.cpp -o hello
It does indeed compile it, but I don't want to have to edit the batch file every time I want to compile a new source. The hello.cpp are just examples.
edit:just noticed the cmd.exe part is unnecessary and didn't do anything anyway due to the typo!
Question
Pompeius
I am wondering if anyone here can help me. I have Visual Studio 08 but I prefer to use the MinGW compiler for small practice applications. The way I have been doing this is primitive so far: I open cmd.exe, cd to the place where I keep my source files, then type in "C:\Program Files\MinGW\bin\c++.exe" followed by the name of the source file and "-o " with a name after.
This is a hassle, and I want to know if there is a way to accomplish this using a batch file, BUT I want it to ask for the name of the source file and the name of the final executable, so that I don't have to manually edit the batch file each time I want to use it. Is this even possible?
A made a simple one that goes as follows:
It does indeed compile it, but I don't want to have to edit the batch file every time I want to compile a new source. The hello.cpp are just examples.
edit:just noticed the cmd.exe part is unnecessary and didn't do anything anyway due to the typo!
Anyone?
Edited by PompeiusLink to comment
Share on other sites
4 answers to this question
Recommended Posts