Sorry, this content is no longer available

Ask Your Question
0

Linking problems while building 3.0.0 on 64 bit linux

asked Apr 23 '15

For some reason my linker keeps trying to link against the static version of libc instead of the dynamic version when building from source. I also tried setting the cmake flag BUILD_SHARED_LIBRARIES to OFF but this led to other problems. Full error below.

Linking CXX shared library ../../lib/libopencv_videoio.so /usr/bin/ld: /usr/local/lib/libc.a(lib_a-mallocr.o): relocation R_X86_64_32S against `__malloc_av_' can not be used when making a shared object; recompile with -fPIC /usr/local/lib/libc.a: error adding symbols: Bad value collect2: error: ld returned 1 exit status make[2]: * [lib/libopencv_videoio.so.3.0.0] Error 1 make[1]: [modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2 make: ** [all] Error 2

Preview: (hide)

1 answer

Sort by » oldest newest most voted
0

answered May 1 '15

For some reason I installed my own static C libraries in /usr/local. OpenCV assumes if you put C libraries there you did it on purpose and uses them instead of the ones installed at /lib. Removing the ones in /usr/local solved the problem.

Preview: (hide)

Question Tools

1 follower

Stats

Asked: Apr 23 '15

Seen: 327 times

Last updated: Apr 30 '15