I am trying to compile OpenCV 3.0 on Fedora 22 with ffmpeg. I encounter the following error:
[ 26%] Building CXX object
modules/core/CMakeFiles/opencv_perf_core.dir/perf/perf_bitwise.cpp.o
Linking CXX executable /global/OpenCV/opencv_perf_core
../../lib/libopencv_videoio.so.3.0.0: undefined reference to `swr_free'
../../lib/libopencv_videoio.so.3.0.0: undefined reference to `swr_init'
../../lib/libopencv_videoio.so.3.0.0: undefined reference to `swr_is_initialized'
../../lib/libopencv_videoio.so.3.0.0: undefined reference to `lzma_code'
../../lib/libopencv_videoio.so.3.0.0: undefined reference to `lzma_end'
../../lib/libopencv_videoio.so.3.0.0: undefined reference to `swr_close'
../../lib/libopencv_videoio.so.3.0.0: undefined reference to `swr_convert'
../../lib/libopencv_videoio.so.3.0.0: undefined reference to `swr_alloc'
../../lib/libopencv_videoio.so.3.0.0: undefined reference to `lzma_stream_decoder'
collect2: error: ld returned 1 exit status
modules/core/CMakeFiles/opencv_perf_core.dir/build.make:770: recipe for target '/global/OpenCV/opencv_perf_core' failed
make[2]: *** [/global/OpenCV/opencv_perf_core] Error 1
CMakeFiles/Makefile2:1245: recipe for target 'modules/core/CMakeFiles/opencv_perf_core.dir/all' failed
make[1]: *** [modules/core/CMakeFiles/opencv_perf_core.dir/all] Error 2
Makefile:136: recipe for target 'all' failed
make: *** [all] Error 2
Any help would be highly appreciated !
Related
Attempting to build open OpenCV in Ubuntu, following this tutorial (specifically the "Build core modules" section), and I get the following error:
[ 71%] Linking CXX executable ../../bin/opencv_test_highgui
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libfontconfig.so: undefined reference to 'uuid_parse#UUID_1.0'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libfontconfig.so: undefined reference to 'uuid_generate_random#UUID_1.0'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libfontconfig.so: undefined reference to 'uuid_unparse#UUID_1.0'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libfontconfig.so: undefined reference to 'uuid_copy#UUID_1.0'
collect2: error: ld returned 1 exit status
make[2]: *** [modules/highgui/CMakeFiles/opencv_test_highgui.dir/build.make:122: bin/opencv_test_highgui] Error 1
make1: *** [CMakeFiles/Makefile2:2754: modules/highgui/CMakeFiles/opencv_test_highgui.dir/all] Error 2
make: *** [Makefile:163: all] Error 2
I imagine this is a missing dependency, but I'm having a hard time finding it. Anyone have a fix?
when I build AR Drone SDK , I get this error.Although I made all the configurations
../../Soft/Build/targets_versions/linux_sdk_demo_PROD_MODE_vlib_Linux_4.4.0-66-generic_GNU_Linux_usrbingcc_5.4.0/Navdata/navdata.o:(.data+0x80): undefined reference to `demo_navdata_client_init'
../../Soft/Build/targets_versions/linux_sdk_demo_PROD_MODE_vlib_Linux_4.4.0-66-generic_GNU_Linux_usrbingcc_5.4.0/Navdata/navdata.o:(.data+0x88): undefined reference to `demo_navdata_client_process'
../../Soft/Build/targets_versions/linux_sdk_demo_PROD_MODE_vlib_Linux_4.4.0-66-generic_GNU_Linux_usrbingcc_5.4.0/Navdata/navdata.o:(.data+0x90): undefined reference to `demo_navdata_client_release'
collect2: error: ld returned 1 exit status
generic.makefile:136: recipe for target '/home/tamercan/Desktop/ARDrone_SDK_2_0_1/ARDrone_SDK_2_0_1/Examples/Linux/sdk_demo/Build/../../Build/Release/ardrone_testing_tool' failed
make[4]: *** [/home/tamercan/Desktop/ARDrone_SDK_2_0_1/ARDrone_SDK_2_0_1/Examples/Linux/sdk_demo/Build/../../Build/Release/ardrone_testing_tool] Error 1
app.makefile:33: recipe for target 'all' failed
make[3]: *** [all] Error 2
Makefile:163: recipe for target 'build_app' failed
make[2]: *** [build_app] Error 2
Makefile:70: recipe for target 'linux_sdk_demo' failed
make[1]: *** [linux_sdk_demo] Error 2
make[1]: Leaving directory '/home/tamercan/Desktop/ARDrone_SDK_2_0_1/ARDrone_SDK_2_0_1/Examples/Linux/sdk_demo/Build'
Makefile:5: recipe for target 'all' failed
make: *** [all] Error 2
Are you using Ubuntu 16.04 or later? Looks like AR.Drone SDK 2.0.1 is not compatible with that version. Last version I was able to compile this SDK was 14.04.
I posted this error in Parrot Developer Forum but the only answer I received is to use a previous version.
http://forum.developer.parrot.com/t/ardrone-sdk-2-0-1-compiling-linux-examples-on-ubuntu-16-04-lts/4168
I am trying to build opencv with opencv_contributions, but I can`t figure out this error at building.
I made cmake like this :
cmake -DOPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-master/modules/ ~/opencv-3.2.0/
And at the end of building i got this error:
[100%] Linking CXX executable ../../bin/opencv_perf_stitching
[100%] Built target opencv_perf_stitching
[100%] Linking CXX shared module ../../lib/cv2.so
/usr/bin/ld: CMakeFiles/opencv_python2.dir/__/src2/cv2.cpp.o: relocation R_X86_64_PC32 against undefined symbol `_Z13pyopencv_fromIN2cv4MatxIdLi4ELi4EEEEP7_objectRKT_' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
modules/python2/CMakeFiles/opencv_python2.dir/build.make:393: recipe for target 'lib/cv2.so' failed
make[2]: *** [lib/cv2.so] Error 1
CMakeFiles/Makefile2:14221: recipe for target 'modules/python2/CMakeFiles/opencv_python2.dir/all' failed
make[1]: *** [modules/python2/CMakeFiles/opencv_python2.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2
recently, after installing OpenCV3, I am not able to use Baxter on Ubuntu 14.04 64 bit OS. However, I removed OpenCV3 later on but the catkin_make on ros indigo workspace is giving following error-
Linking CXX executable /home/ravi/ros_ws/devel/lib/baxter_sim_hardware/baxter_emulator
[100%] Built target baxter_sim_io
CMakeFiles/baxter_emulator.dir/src/baxter_emulator.cpp.o: In function `baxter_en::baxter_emulator::publish(std::string const&)':
baxter_emulator.cpp:(.text+0x2087): undefined reference to `cv::imread(cv::String const&, int)'
CMakeFiles/baxter_emulator.dir/src/baxter_emulator.cpp.o: In function `cv::String::~String()':
baxter_emulator.cpp:(.text._ZN2cv6StringD2Ev[_ZN2cv6StringD5Ev]+0x14): undefined reference to `cv::String::deallocate()'
CMakeFiles/baxter_emulator.dir/src/baxter_emulator.cpp.o: In function `cv::String::String(std::string const&)':
baxter_emulator.cpp:(.text._ZN2cv6StringC2ERKSs[_ZN2cv6StringC5ERKSs]+0x69): undefined reference to `cv::String::allocate(unsigned long)'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/ravi/ros_ws/devel/lib/baxter_sim_hardware/baxter_emulator] Error 1
make[1]: *** [baxter_simulator/baxter_sim_hardware/CMakeFiles/baxter_emulator.dir/all] Error 2
make: *** [all] Error 2
Invoking "make -j8 -l8" failed
OpenCV3 was installed from the source using this script. This script has installed some additional libraries as well. I removed OpenCV3 by following command-
cd OpenCV/build
sudo make unistall
sudo ldconfig
but catkin_make is still showing same error.
I plan on beginning to work with facial recognition more, and so I tried to install dlib. I followed the instructions:
cd examples
mkdir build
cd build
cmake ..
cmake --build . --config Release
And the only one that failed was the last one. It ran fine up untill it got to 99% complete, and then:
Scanning dependencies of target train_shape_predictor_ex
[ 96%] Building CXX object CMakeFiles/train_shape_predictor_ex.dir/train_shape_predictor_ex.cpp.o
[ 96%] Linking CXX executable train_shape_predictor_ex
[ 96%] Built target train_shape_predictor_ex
Scanning dependencies of target using_custom_kernels_ex
[ 96%] Building CXX object CMakeFiles/using_custom_kernels_ex.dir/using_custom_kernels_ex.cpp.o
[ 97%] Linking CXX executable using_custom_kernels_ex
[ 97%] Built target using_custom_kernels_ex
Scanning dependencies of target video_tracking_ex
[ 97%] Building CXX object CMakeFiles/video_tracking_ex.dir/video_tracking_ex.cpp.o
[ 98%] Linking CXX executable video_tracking_ex
[ 98%] Built target video_tracking_ex
Scanning dependencies of target webcam_face_pose_ex
[ 98%] Building CXX object CMakeFiles/webcam_face_pose_ex.dir/webcam_face_pose_ex.cpp.o
[ 99%] Linking CXX executable webcam_face_pose_ex
/usr/local/lib/libopencv_highgui.so.2.4.11: undefined reference to `TIFFIsTiled#LIBTIFF_4.0'
/usr/local/lib/libopencv_highgui.so.2.4.11: undefined reference to `TIFFOpen#LIBTIFF_4.0'
/usr/local/lib/libopencv_highgui.so.2.4.11: undefined reference to `TIFFReadEncodedStrip#LIBTIFF_4.0'
/usr/local/lib/libopencv_highgui.so.2.4.11: undefined reference to `TIFFSetField#LIBTIFF_4.0'
/usr/local/lib/libopencv_highgui.so.2.4.11: undefined reference to `TIFFWriteScanline#LIBTIFF_4.0'
/usr/local/lib/libopencv_highgui.so.2.4.11: undefined reference to `TIFFGetField#LIBTIFF_4.0'
/usr/local/lib/libopencv_highgui.so.2.4.11: undefined reference to `TIFFScanlineSize#LIBTIFF_4.0'
/usr/local/lib/libopencv_highgui.so.2.4.11: undefined reference to `TIFFSetWarningHandler#LIBTIFF_4.0'
/usr/local/lib/libopencv_highgui.so.2.4.11: undefined reference to `TIFFSetErrorHandler#LIBTIFF_4.0'
/usr/local/lib/libopencv_highgui.so.2.4.11: undefined reference to `TIFFReadEncodedTile#LIBTIFF_4.0'
/usr/local/lib/libopencv_highgui.so.2.4.11: undefined reference to `TIFFReadRGBATile#LIBTIFF_4.0'
/usr/local/lib/libopencv_highgui.so.2.4.11: undefined reference to `TIFFClose#LIBTIFF_4.0'
/usr/local/lib/libopencv_highgui.so.2.4.11: undefined reference to `TIFFRGBAImageOK#LIBTIFF_4.0'
/usr/local/lib/libopencv_highgui.so.2.4.11: undefined reference to `TIFFReadRGBAStrip#LIBTIFF_4.0'
collect2: error: ld returned 1 exit status
make[2]: *** [webcam_face_pose_ex] Error 1
make[1]: *** [CMakeFiles/webcam_face_pose_ex.dir/all] Error 2
make: *** [all] Error 2
It looks to me like I'm just missing a few files. How would I fix that?
This is well-known problem of OpenCV with LibTIFF 4 on some Ubuntu versions. Take a look here:
http://answers.opencv.org/question/35642/libtiff_40-link-errors/