OpenCV compile error

asked 2015-09-24 09:17:45 -0600

On Compiling opencv 2.4.11 on the ubuntu 14.04, I received the following error: -

Linking CXX shared library ../../lib/libopencv_core.so /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libm.so when searching for -lm /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libm.a(s_sin.o): relocation R_X86_64_32S against `__sincostab' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/libm.a: error adding symbols: Bad value collect2: error: ld returned 1 exit status

make[2]: * [lib/libopencv_core.so.2.4.11] Error 1

make[1]: * [modules/core/CMakeFiles/opencv_core.dir/all] Error 2 make: * [all] Error 2

It just stops at 21% and shows the error.image description

Can anyone tell me what can be done??

edit retag flag offensive close merge delete

Comments

Have you searched on google? To me it seems that you have more versions of the same lib ... is it?

thdrksdfthmn gravatar imagethdrksdfthmn ( 2015-09-24 09:51:55 -0600 )edit

yeah I guess. When i search for libm.a It shows this :-

/home/akash/Downloads/gcc-linaro-4.9-2015.02-3-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc/usr/lib/libm.a

/usr/arm-linux-gnueabi/lib/libm.a

/usr/arm-linux-gnueabihf/lib/libm.a

/usr/arm-linux-gnueabihf/libsf/libm.a

/usr/lib/x86_64-linux-gnu/libm.a

/usr/local/DS-5_v5.21.1/sw/gcc/arm-linux-gnueabihf/libc/usr/lib/arm-linux-gnueabi/libm.a

/usr/local/DS-5_v5.21.1/sw/gcc/arm-linux-gnueabihf/libc/usr/lib/arm-linux-gnueabihf/libm.a

And yes I have downloaded gcc-4.7, 4.8 and 4.9, because I thought may be some tool chain error is there! Should I remove all and keep one only?

akash_sachdeva gravatar imageakash_sachdeva ( 2015-09-25 05:04:59 -0600 )edit

interesting.... you should go to askubuntu or other specialised forums, this is not about opencv

thdrksdfthmn gravatar imagethdrksdfthmn ( 2015-09-25 05:56:58 -0600 )edit

Okay. I have done some changes..using cmake-gui. I am getting this error now on make command: -

make[2]: * [3rdparty/lib/libzlib.a] Error 2

make[1]: * [3rdparty/zlib/CMakeFiles/zlib.dir/all] Error 2

make: * [all] Error 2

I have check, 3rdparty/lib is empty

akash_sachdeva gravatar imageakash_sachdeva ( 2015-09-25 07:14:54 -0600 )edit

Does anyone knows how to add this patch?? May be this will solve the problem: -

http://lists.busybox.net/pipermail/bu...

akash_sachdeva gravatar imageakash_sachdeva ( 2015-09-28 08:11:52 -0600 )edit