I have been trying all day to install OpenCV (versions 2.4.1 and 2.4.2) for Visual Studio 2010 on Windows 7 for C/C++.
I have been following this tutorial: http://docs.opencv.org/trunk/doc/tutorials/introduction/windows_install/windows_install.html
I skipped installing 3rd party software (except python 2.7 and zlib from here: http://gnuwin32.sourceforge.net/packages/zlib.htm).
I run cmake, then open openCV.sln from openCV build directory, wait for visual studio to load and then build it. Visual studio gives 200 hundred errors which are just the following two repeated many times:
error C1083: Cannot open include file: 'unistd.h': No such file or directory
error LNK1104: cannot open file '....\lib\Debug\opencv_core241d.lib'
"OpenCV build directory"/bin/Release does not contain any *.exe file, just a plenty of *.pdb files, among which I can see contours.pdb. The tutorial says that I should see contours.exe there.
As there are no *.exe files, I understand that two errors I get during build are critical. I would be grateful for any ideas that could help me solve them.
Building the OpenCV library from scratch requires a couple of tools installed beforehand: An IDE of choice (preferably), or just a CC++ compiler that will actually make the binary files. Here we will use the Microsoft Visual Studio. However, you can use any other IDE that has a valid CC++ compiler.
The following interpretation of the build steps should help you build it:
Install cmake - this is required for all platforms
cd into the extracted directory and create a new directory called release(or any other name)
From this directory, run cmake ..
You should find an OpenCV.sln file in the release directory.
Open this with Visual Stuido and run a build.
Go ahead and enjoy Opencv
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With