Linking CXX shared library ..\..\bin\libopencv_core341.dll CMAKE/QT ERROR ?

asked 2018-03-15 05:27:10 -0600

RPH gravatar image

updated 2018-03-15 06:12:22 -0600

Hi, I am trying to setup the OpenCV image processing library v3.4.1 with QT v5.10.1 and cmake-gui v3.10.2 using the guide here: How_to_setup_Qt_and_openCV_on_Windows. I am using Windows 7 64bit.

I have followed all instructions exactly but when I run the command mingw32-make I get the following error:

[ 37%] Linking CXX shared library ..\..\bin\libopencv_core341.dll
CMakeFiles\opencv_core.dir/objects.a: member CMakeFiles\opencv_core.dir/objects.
a(vs_version.rc.obj) in archive is not an object
collect2.exe: error: ld returned 1 exit status
modules\core\CMakeFiles\opencv_core.dir\build.make:2329: recipe for target 'bin/
libopencv_core341.dll' failed
mingw32-make[2]: *** [bin/libopencv_core341.dll] Error 1
CMakeFiles\Makefile2:1675: recipe for target 'modules/core/CMakeFiles/opencv_cor
e.dir/all' failed
mingw32-make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2
Makefile:161: recipe for target 'all' failed
mingw32-make: *** [all] Error 2

I have already tried disabling "pre-compiled-headers" in CMAKE. I have searched endlessly for a solution but nothing has worked thus far.

OpenCV v2.4.13.6 compiles/builds without any issues.

Any help is appreciated, thanks !

edit retag flag offensive close merge delete

Comments

try linking against libopencv_core341.dll.a , the archive file, not the dll

berak gravatar imageberak ( 2018-03-15 05:58:31 -0600 )edit

@berak How would I go about doing that with CMAKE-GUI ? I forgot to mention that OpenCV v2.4.13.6 compiles/builds without problems. Thanks

RPH gravatar imageRPH ( 2018-03-15 06:06:53 -0600 )edit

apologies, i misread the error. no idea, now. ;(

"disabling "pre-compiled-headers" in CMAKE" -- yes, correct.

"QT v5.10.1" -- what does g++ --version say ?

berak gravatar imageberak ( 2018-03-15 06:08:57 -0600 )edit

@berakg++ (x86_64-posix-seh, Built by strawberryperl.com project) 7.1.0 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

RPH gravatar imageRPH ( 2018-03-15 06:16:25 -0600 )edit

that looks quite fresh (and it works with 7.2 for me). out of ideas, sorry.

was that your 1st attempt at building the libs ? if NOT so, it might be a good idea, to delete the whole build folder, and start from scratch with cmake (maybe some previous artefacts got in your way)

berak gravatar imageberak ( 2018-03-15 06:45:38 -0600 )edit
1

@berak Nope, I have tried it from scratch many times before. Each time I've tried something different but it never works.

RPH gravatar imageRPH ( 2018-03-15 07:05:33 -0600 )edit