2013-05-01 3 views
2

Je suis en train d'installer OpenCV 2.4.5 sur Ubuntu 12.04 J'ai essayé suivant les étapes http://opencv.willowgarage.com/wiki/InstallGuide_LinuxOpenCV 2.4.5 faire erreur

Cependant quand je tends l'étape make. Je reçois une erreur. Je suis nouveau à linux.

L'erreur est

Linking CXX shared library ../../lib/libopencv_highgui.so 
/usr/bin/ld: /usr/local/lib/libavcodec.a(avpacket.o): relocation R_X86_64_32 against `.rodata.str1.1' 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 
make[2]: *** [lib/libopencv_highgui.so.2.4.5] Error 1 
make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2 
make: *** [all] Error 2 

S'il vous plaît aider !!!

+0

Je suis assez sûr que le lien est obsolète –

+2

@peterretief Droit, le bon est [ici] (http://docs.opencv.org/doc/tutorials/introduction/linux_install/linux_install.html) – StreakyCobra

Répondre

5

Il semble que ffmpeg ait été le coupable. D'une certaine manière, cela créait des problèmes. J'ai désinstallé ffmpeg et installé OpenCV en suivant les instructions mentionnées. Maintenant, j'ai OpenCV 2.4.5 installé sans le support de FFMPEG. Mais au moins, ça marche!

Edit:
J'ai suivi les instructions http://www.ozbotz.org/opencv-installation/ OpenCV 2.4.5 est maintenant installé correctement. Je suis sur 64bit Ubuntu 12.04 Comme les paramètres --enable-shared --enable-pic manquaient dans les commandes de compilation lib264 et ffmpeg, l'erreur mentionnée dans la question a été levée.

En suivant ces instructions, vous avez résolu le problème.

1

GCC:

$ sudo apt-get update 
$ sudo apt-get install build-essential 

Utilisez les versions ultérieures si elles sont disponibles (Assurez-vous que vous obtenez la bonne version pour votre matériel et système d'exploitation si)

Cmake:
http://www.cmake.org/files/v2.8/cmake-2.8.10.2.tar.gz

$ tar -xf cmake-2.8.10.2.tar.gz 
$ cd cmake-2.8.10.2 
$ ./configure 
$ make -j4 
$ sudo make install 

Opencv: http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.3/OpenCV-2.4.3.tar.bz2/download

$ tar -xf OpenCV-2.4.3.tar.bz2 
$ cd OpenCV-2.4.3 
$ mkdir build 
$ cd build 
$ cmake -D CMAKE_BUILD_TYPE=Release .. 
$ make -j4 
$ sudo make install 
+0

thnx! :) J'ai suivi ces étapes mais je n'ai pas réussi à l'installer initialement. Ffmpeg désinstallé et cela a fonctionné. –