Ask Your Question

mnems's profile - activity

2016-07-27 03:18:16 -0600 received badge  Enthusiast
2016-07-20 04:45:23 -0600 received badge  Editor (source)
2016-07-19 09:09:51 -0600 commented question Windows - cmake succeed but make failed [closed]

I manage to partially-succeed the build by switching the compiler from mingw64\bin\g++ to usr\bin\g++ However I still have an issue, although I can declare variable such as Mat Image (see the tuto), I cannot call 'imread' without receiving this compilation error : undefined reference to « cv::String::allocate(unsigned long) »

2016-07-19 04:03:01 -0600 asked a question Windows - cmake succeed but make failed [closed]

Hi everyone,

I know there are a lot of topic about openCV compilation but I cannot find a solution to my issue. Under windows 7 I have successfully download and compiled openCV source using cmake. To be sure of it I have executed opencv_test_core which seems to work. Now that I want to make my own project, I followed this tuto http://docs.opencv.org/3.1.0/db/df5/t... I am using cmake GUI and configuration and generation seem to work, I have this result without warnings : Configuring done Generating done. When I try to lauch the make command I have this return :

$ make

Scanning dependencies of target DisplayImage [ 50%] Building CXX object CMakeFiles/DisplayImage.dir/DisplayImage.cpp.obj make[2]: * [CMakeFiles/DisplayImage.dir/build.make:64: CMakeFiles/DisplayImage.dir/DisplayImage.cpp.obj] Error 1 make[1]: [CMakeFiles/Makefile2:68: CMakeFiles/DisplayImage.dir/all] Error 2 make: ** [Makefile:84: all] Error 2

I don't know where to find more log about this error and I have no idea where the problem is... Does someone have an idea about it ?

EDIT: I compiled in debug mode for more output

CMakeFiles/DisplayImage.dir/objects.a(DisplayImage.cpp.obj): in « cv::String::String(char const) »: C:/dev/sdk/OpenCV/opencv/build/x64/cmake/install/include/opencv2/core/cvstd.hpp:625: undefined reference to « cv::String::allocate(unsigned long) » C:/dev/sdk/OpenCV/opencv/build/x64/cmake/install/include/opencv2/core/cvstd.hpp:625:(.text$_ZN2cv6StringC1EPKc[_ZN2cv6StringC1EPKc]+0x4a): relocation truncated to fit : R_X86_64_PC32 to the undefined symbol cv::String::allocate(unsigned long) collect2: error: ld returned 1 exit status make[2]: [CMakeFiles/DisplayImage.dir/build.make:115: DisplayImage.exe] Error 1 make[1]: [CMakeFiles/Makefile2:68: CMakeFiles/DisplayImage.dir/all] Error 2 make: ** [Makefile:84: all] Error 2

According to what I read it seems to be a library link order issue.

EDIT 2: Well, I tried to answer my own question but since I am new my answer just get erased... :( I solved the issue by using the same compiler version when compiling opencv from sources and my project. Plus I had to use mingw64 terminal instead of msys terminal. Don't know why since they have the same PATH var and use the same 'make'... Anyway lena is now showing on the screen which is quit a relief for me!