Ask Your Question

viziens's profile - activity

2014-04-07 15:51:50 -0600 received badge  Student (source)
2014-04-07 04:56:38 -0600 asked a question Compiling OpenCV 2.4.8 on Ubuntu 13.10

Hello all,

I am new over here and I would kindly ask you for some help regarding the problem that I have with compiling OpenCV for Java. No matter what I do (I am fighting with this for two whole days) I always get this error.

/usr/bin/ld: ../../lib/libopencv_highgui.a(cap_libv4l.cpp.o): undefined reference to symbol 'v4l2_close'
/usr/lib/x86_64-linux-gnu/libv4l2.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [bin/opencv_test_highgui] Error 1
make[1]: *** [modules/highgui/CMakeFiles/opencv_test_highgui.dir/all] Error 2
make: *** [all] Error 2

I should mention that I need camera support, so ignoring libv4l errors doesn't help. I tried every possible combination without success, I always get this error. I even tried using this script (I modified script I found for 2.4.2) and it still didn't work.

echo "Installing OpenCV 2.4.8"
mkdir OpenCV
cd OpenCV
echo "Removing any pre-installed ffmpeg and x264"
sudo apt-get remove ffmpeg x264 libx264-dev
echo "Installing Dependenices"
sudo apt-get -y install libopencv-dev
sudo apt-get -y install build-essential checkinstall cmake pkg-config yasm
sudo apt-get -y install libtiff4-dev libjpeg-dev libjasper-dev
sudo apt-get -y install libfaac-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev
sudo apt-get -y install python-dev python-numpy
sudo apt-get -y install libtbb-dev
sudo apt-get -y install libqt4-dev libgtk2.0-dev
echo "Downloading ffmpeg"
wget http://ffmpeg.org/releases/ffmpeg-2.2.tar.bz2
echo "Installing ffmpeg"
tar -xvf ffmpeg-2.2.tar.bz2
cd ffmpeg-2.2/
./configure --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab
make
sudo make install
cd ..
echo "Downloading v4l"
wget http://www.linuxtv.org/downloads/v4l-utils/v4l-utils-1.0.1.tar.bz2
echo "Installing v4l"
tar -xvf v4l-utils-1.0.1.tar.bz2
cd v4l-utils-1.0.1/
make
sudo make install
cd ..
echo "Downloading OpenCV 2.4.8"
wget -O OpenCV-2.4.8.zip http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.8/opencv-2.4.8.zip/download
echo "Installing OpenCV 2.4.8"
unzip OpenCV-2.4.8.zip
cd opencv-2.4.8
mkdir build
cd build
cmake -D BUILD_SHARED_LIBS=OFF ..
make -j8
sudo make install
sudo echo “/usr/local/lib” >> /etc/ld.so.conf
sudo ldconfig
echo "OpenCV 2.4.8 ready to be used"

I am not the first one with this problem, I tried everything that was sugested on other forums and nothing helped. I have libv4l-devel installed, I even tried compiling v4l-utils as can be seen above, but no luck.

Did anyone encounter this problem? Any help would be highly appreciated!

Igor