Problem to set Visual Studio for OpenCV
I have followed the OpenCV guides for installation in Windows and setting of Visual Studio but I have problem if I understood all step correctly. The folder structure is different.
My system is Windows XP. IDE Visual Studio 2010. Downloaded and installed OpenCV 3.1
@echo %OPENCV_DIR%
prints
P:\PROGRAMY\programming\OpenCV
notice: I have added both as system environment variable (+rebooted PC) and as user environment variable (+relogged user, no reboot).
here is my directory structure:
>p:
>cd \PROGRAMY\programming\OpenCV
>dir /b /o:d
build 3.1
sources
>cd \PROGRAMY\programming\OpenCV\build 3.1
>dir /b /o:d
bin
include
etc
lib
These folders I have moved from installation folder from build. I use 32 bit Windows, I skipped Java, Perl and 64 bit things. Note there is bin/opencv_ffmpeg310.dll and lib/opencv_ffmpeg310.dll - same size files - only dlls/lib I have. I expect this to be the opencv main library, right?
The P:\PROGRAMY\programming\OpenCV\build 3.1\include\ has two folders opencv and opencv2 ? Here it is not clear which folder should be included because in doc one one folder is shown.
>cd \PROGRAMY\programming\OpenCV\sources
>dir /b /o:d
>dir /b /o:d
samples
platforms
modules
include
doc
data
cmake
apps
3rdparty
here are all sources
In my project I have set Release and Debug profile: Linker -> General -> Additional Library Dependecies: $(OPENCV_DIR)\build 3.1\lib Linker -> Input .. no change here. Here are standard Windows libraries: kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) I tried to add one library but I found the lib files are not part of the distribution. (sad). I have read there is needed to add some libraries, but no *.lib files I found in the folders.
Now I have created the file main.cpp which includes these files:
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
then I build and I got this error:
1>------ Build started: Project: OPEN CL, Configuration: Debug Win32 ------
1>LINK : error LNK2001: unresolved external symbol _mainCRTStartup
1>U:\C++\openCV\test 00\Debug\OPEN CL.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Note that if I include both directories include/opencv and include/opencv2 it still generates same error.
What do I do wrong during installation that I am not able to compile the program in guide? Do I need to include some lib files?
Links: http://docs.opencv.org/2.4/doc/tutori... http://docs.opencv.org/2.4/doc/tutori...
Edit: After creating new clear project and setting include directories I can compile single program. But when I try to include OpenCV core so it will print error. Do I need to link any library? Which file? I cannot link opencv_ffmpeg310.dll it would print error that file is corrupt (There are two files like this, both error ...