After successfully setting up OpenCV2.0 with MinGW in windows, I started off with my project.
I was really annoyed at copying long string to cmd.exe to compile and link my project and then to execute by opening .exe file.
So I started searching about dos batch and wrote my own script to compile and execute my project in one go.
The script is as follows:
How to use it? Simple! Copy paste this script in Notepad and save as run.bat on desktop. Open by double clicking run.bat then enter filename excluding the extension (which this script takes as .cpp but can be changed for ones requirement) to compile and execute your code. After first compiling and executing a code, the script loops back to start. Now if you want to compile and execute the same code again, you can just press enter key, the script will automatically take the last entered filename.
Thats all for now, right now I dont have much time to improve this script as I am working on my project. Soon I will be posting about my own project as well. Till then cyaa, happy coding :D
I was really annoyed at copying long string to cmd.exe to compile and link my project and then to execute by opening .exe file.
So I started searching about dos batch and wrote my own script to compile and execute my project in one go.
The script is as follows:
I am doing all my coding in the folder e:\cvprog , therefore everytime it runs it goes to that folder first. You can change the folder location to your own project folder.cls@ECHO OFFe:cd\cvprog
:Stecho Enter the file to compile and link (enter for last file)set/p "filee=>"
g++ -Ic:\OpenCv2.0MingW\include\opencv -oo -g3 -Wall -c -otemp.o %filee%.cppg++ -Lc:\OpenCv2.0MingW\lib -o%filee%.exe temp.o -lcv200d -lcvaux200d -lcxcore200d -lcxts200d -lhighgui200d -lml200d
echo Bazzingaaa!!%filee%.exeset/p "in=>"if %in%==q goto exitaif %in%==Q goto exitagoto St:exita
How to use it? Simple! Copy paste this script in Notepad and save as run.bat on desktop. Open by double clicking run.bat then enter filename excluding the extension (which this script takes as .cpp but can be changed for ones requirement) to compile and execute your code. After first compiling and executing a code, the script loops back to start. Now if you want to compile and execute the same code again, you can just press enter key, the script will automatically take the last entered filename.
Thats all for now, right now I dont have much time to improve this script as I am working on my project. Soon I will be posting about my own project as well. Till then cyaa, happy coding :D