How to generate(compile) .exe for opencv 3.0 c++ program from command prompt in windows10? Basically I wan to generte .exe file by running the scource code in command prompt.
-
Do you have an .exe? If so, just type it's full path into the command window. If not, create an .exe first. – Anon Mail Nov 06 '15 at 16:42
-
Sorry My question was wrong. I wan to generate .exe through command prompt on windows10 platform for opencv 3.0 c++ code. – pradeepln4 Nov 06 '15 at 16:48
-
Your best bet is to contact the person who wrote the code. Barring that, you will have to look at the opencv documentation for your particular compiler. – Anon Mail Nov 06 '15 at 18:06
1 Answers
It really depends on the compiler you are using. If I go on the assumption you are looking to compile with MinGW on Windows Check out this thread for exact step by step instructions... Its for windows 7 but with updated downloads the steps should be very, very close. Getting started with OpenCV 2.4 and MinGW on Windows 7
But the exact command would be something like this... g++ -I"C:\opencv\build\include" L"C:\opencv\build\x86\mingw\lib" loadimg.cpp -lopencv_core243 -lopencv_highgui243 -o loadimg Replace loadimg for your files
Edit for OpenCV 3.0
So I did a little more looking (haven't used 3.0) and it appears the most common way is to use Visual Studio - http://docs.opencv.org/2.4/doc/tutorials/introduction/windows_visual_studio_Opencv/windows_visual_studio_Opencv.html?highlight=build I would recommend this approach if possible. It's the supported way and has good documentation. If you need a copy of Visual Studio - the community edition is free for up to five users. https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx . Also you can use MSBUILD https://msdn.microsoft.com/en-us/library/f35ctcxw.aspx to compile the program from the command line.
Alternatively, I did find some info on building the core from code using CMAKE. But it does not mention using MinGW. http://docs.opencv.org/2.4/doc/tutorials/introduction/windows_install/windows_install.html#cpptutwindowsmakeown. There does seem to be a lack of information on the this topic though.

- 1
- 1

- 109
- 5
-
1Problem is with opencv 3.0 version there is no mingw \ lib folder in C:\opencv\build\x86...I am trying to build it using CMake but there is no proper documentation available for this on web for windows platform – pradeepln4 Nov 07 '15 at 06:40
-
It did not for opencv 3.0. I made extensive search on web still there was no documentation for opencv 3.0. – pradeepln4 Nov 12 '15 at 04:11