Ask Your Question
0

installation OpenCV3 on windows using prebuilt binaries

asked 2016-11-02 03:53:55 -0600

enxdtw gravatar image

updated 2016-11-02 05:24:44 -0600

Hi,

I had trouble compiling on windows for x64 so I thought I would try just using the binaries (using the following guide).

http://docs.opencv.org/3.0-last-rst/d...

I downloaded version 3.1.0 ran the setup then saw that there are directories

C:\OpenCV\sources\include

and

C:\OpenCV\build\x64\vc14\lib

The lib directory only includes one lib file (and the debug version)

opencv_world310.lib

I was expecting to use

-lopencv_shape310 -lopencv_core310 -lopencv_highgui310 -lopencv_imgproc310 -lopencv_imgcodecs310

So either the libraries have changed and there is only one file to link against or the distribution is incomplete or there are no pre-built binaries and you have to build them yourself. Either way the documentation is not correct.

Anyway so I tried to build using CMAKE everything goes ok, but everything is built for WIN32 which is not compatible with my QT version and is anyway not really the latest technology. I changed all the WIN32 flags in CMAKE to be WIN64, better but still compiles certain libraries as X86 (actually on the last attempt I got 319 errors - see comment below). Surely a simple install of the latest opencv version on the most popular OS should not be so difficult and poorly explained.

Thanks for any help

Cheers Dave

edit retag flag offensive close merge delete

Comments

Just want to mention that when I try to build using MSVC++ 15 using the CMAKE generated solution file I get 319 errors! here a 3 examples

Severity Code Description Project File Line Suppression State Error C1083 Cannot open include file: 'pthread.h': No such file or directory opencv_core C:\OpenCV\modules\core\src\rand.cpp 58

Severity Code Description Project File Line Suppression State Error C2146 syntax error: missing ';' before identifier 'sysinfo' opencv_core C:\OpenCV\modules\core\src\parallel.cpp 523

Severity Code Description Project File Line Suppression State Error LNK1104 cannot open file '....\lib\Debug\opencv_core310d.lib' opencv_imgproc C:\opencv-msvc\modules\imgproc\LINK 1

enxdtw gravatar imageenxdtw ( 2016-11-02 05:23:16 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2016-11-04 04:50:21 -0600

enxdtw gravatar image

Seems I had 2 problems with the CMAKE settings, first was that WITH_CUDA was selected (as default!), second was that to compile for 64 bits only change the CMAKE_*_LINKER_FLAGS to /machine:x64 dont mess with the WIN32 settings even though it looks like they are 32 bit, its legacy windows shit, setting them to WIN64 will also cause VS to fail to compile. Then you have to rebuild ALL followed by the INSTALL project, in both debug and release, add the path to where the DLL's are located, link and include the libraries. I also unchecked the WITH_WIN32UI, probably not a good idea since cvshow then doesn't work. Would be nice if doiing a 64 bit opencv build on windows is better documented

edit flag offensive delete link more

Comments

seems the opencv_world prebuilt files are also usable (QT .pro example)

INCLUDEPATH += C:/opencv/build/include LIBS += -LC:/opencv/build/x64/vc14/lib

debug { LIBS += -lopencv_world310d

} release { LIBS += -lopencv_world310 }

add C:\opencv\build\x64\vc14\bin to the system path

enxdtw gravatar imageenxdtw ( 2016-11-04 05:42:11 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-11-02 03:53:55 -0600

Seen: 1,658 times

Last updated: Nov 04 '16