【发布时间】:2012-01-12 06:59:11
【问题描述】:
我正在尝试按照here 中描述的说明在 Ubuntu 11.10 上编译 OpenCV 版本 2.3.1。我收到以下错误。无法理解发生了什么.../usr/local/lib/libavcodec.a 存在,但链接器无法链接到它,或者其他什么?
错误:
[ 20%] Built target pch_Generate_opencv_highgui
Linking CXX shared library ../../lib/libopencv_highgui.so
/usr/bin/ld: /usr/local/lib/libavcodec.a(avpacket.o): relocation R_X86_64_32S against `av_destruct_packet'
can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libavcodec.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
【问题讨论】:
-
您是否尝试过按照错误提示使用 -fPIC 进行编译?
-
编译什么? OpenCV 本身?
-
@RCE 如何将 -fPIC 标志添加到编译器/链接器?我应该编辑 MakeFile 吗?
标签: opencv compilation linker compiler-errors