Labels

Linux (6) OpenCV (4) Deep Learning (3) MATLAB (3) Mac OS X (3) Windows (2) C# (1) Node JS (1)

2013年5月23日 星期四

Solve the "recompile with -fPIC" error when compiling OpenCV with FFMPEG

The error happens while one wants to compile OpenCV with FFMPEG on 64 bits linux. Adding the parameter "--enable-pic" is not enough. Both the --enable-shared and --enable-pic need to be included when configuring ffmpeg:

./configure --enable-shared --enable-pic


For more details, please refer to :

A Comprehensive Guide to Installing and Configuring OpenCV 2.4.2 on Ubuntu
http://www.ozbotz.org/opencv-installation/

I have successfully compiled on Fedora 64 bits. Good luck.



Create links to old OpenCV libraries

Thanks to Michael C. Hughes, which posted a method to create symbolic links of old OpenCV libraries. Here is the original blog:
http://web.michaelchughes.com/how-to/install-stip-software-with-opencv-v2

Here is the way to link OpenCV old library (< 2.0) to latest versions :


  • libcxcore.so.2   --->  libopencv_core.so
  • libcv.so.2         ---> libopencv_imgproc.so
  • libhighgui.so.2  ---> libopencv_highgui.so
  • libml.so.2        --->  libopencv_ml.so
  • libcvaux.so.2    --->  libopencv_video.so
via the commands:

cd </PATH/TO/OPENCV/lib>
ln -s  libopencv_core.so  libcxcore.so.2

ln -s  libopencv_imgproc.so  libcv.so.2
ln -s  libopencv_highgui.so libhighgui.so.2
ln -s  libopencv_ml.so libml.so.2
ln -s libopencv_video.so  libcvaux.so.2