Make error in OPENCV installation - linux

I was trying to install opencv in linux mint. I run the cmake command in the opencv folder.
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
But i get the some errors related to pango while running make command in the release folder :
//usr/lib/x86_64-linux-gnu/libgtk-3.so.0: undefined reference to `pango_attr_font_features_new'
//usr/lib/x86_64-linux-gnu/libgtk-3.so.0: undefined reference to `pango_renderer_set_alpha'
//usr/lib/x86_64-linux-gnu/libgtk-3.so.0: undefined reference to `pango_layout_get_serial'
//usr/lib/x86_64-linux-gnu/libgtk-3.so.0: undefined reference to `pango_attr_background_alpha_new'
//usr/lib/x86_64-linux-gnu/libgtk-3.so.0: undefined reference to `pango_layout_get_log_attrs_readonly'
//usr/lib/x86_64-linux-gnu/libgtk-3.so.0: undefined reference to `pango_fc_font_map_config_changed'
//usr/lib/x86_64-linux-gnu/libgtk-3.so.0: undefined reference to `pango_renderer_get_alpha'
//usr/lib/x86_64-linux-gnu/libgtk-3.so.0: undefined reference to `pango_attr_foreground_alpha_new'
collect2: error: ld returned 1 exit status
modules/highgui/CMakeFiles/opencv_test_highgui.dir/build.make:129: recipe for target 'bin/opencv_test_highgui' failed
make[2]: *** [bin/opencv_test_highgui] Error 1
CMakeFiles/Makefile2:7412: recipe for target 'modules/highgui/CMakeFiles/opencv_test_highgui.dir/all' failed
make[1]: *** [modules/highgui/CMakeFiles/opencv_test_highgui.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2

you need to work on virtual enviroment restart with $ mkvirtualenv cv -p python2

Related

Error! libgsttag-1.0.so.0: undefined reference to `gst_type_find_helper_get_range_full'

I have been trying to build a node which uses GStreamer and gst-plugins-bad. I am encountering the following build error, and I cannot seem to figure out what to do to resolve the issue. Any direction is greatly appreciated if you require more information please ask and I'll see what I can provide.
Errors << node_cameras:make /home/xavier/catkin_ws/logs/node_cameras/build.make.021.log
/usr/bin/ld: warning: libopencv_imgproc.so.3.4, needed by /usr/local/lib/libopencv_calib3d.so.3.4.6, may conflict with libopencv_imgproc.so.3.2
/usr/bin/ld: warning: libopencv_imgcodecs.so.3.4, needed by /usr/local/lib/libopencv_highgui.so.3.4.6, may conflict with libopencv_imgcodecs.so.3.2
**//usr/lib/aarch64-linux-gnu/libgsttag-1.0.so.0: undefined reference to `gst_type_find_helper_get_range_full'**
collect2: error: ld returned 1 exit status
make[2]: *** [/home/xavier/catkin_ws/devel/.private/node_cameras/lib/node_cameras/node_cameras_node] Error 1
make[1]: *** [CMakeFiles/node_cameras_node.dir/all] Error 2
make: *** [all] Error 2
cd /home/xavier/catkin_ws/build/node_cameras; catkin build --get-env node_cameras | catkin env -si /usr/bin/make --jobserver-fds=6,7 -j; cd -

lfs 6.41 XMLParser undefined reference to symbol 'pthread_attr_getstacksize##GLIBC_2.2.5'

I have an issue while building LFS system,
I'm at point 6.41 and I'm building XML:Parser
I'm making
perl Makefile.PL
make
make test
and then I got
/usr/bin/ld: /tools/lib/perl5/5.30.0/x86_64-linux/auto/threads/threads.a(threads.o): undefined reference to symbol 'pthread_attr_getstacksize##GLIBC_2.2.5'
/usr/bin/ld: /lib/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile.aperl:1095: perl] Error 1
make[1]: Leaving directory '/sources/XML-Parser-2.44'
make: *** [Makefile:928: perl] Error 2
Have you an idea of how I can fix that ?
Thanks
I've fix it adding -lpthread to /mnt/lfs/sources/XML-Parser-2.44/Expat/Makefile.PL
on the line
my $libs = "-lexpat -lpthread";

OpenPose Library - build release issue

We are trying to install and run a demo for OpenPose Library available on Github :
https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/doc/installation.md#manual-compilation
Done with installing Caffe and all prerequisites, but while performing install command we are getting following errror :
CXX examples/tutorial_wrapper/2_user_synchronous.cpp
AR -o .build_release/lib/libopenpose.a
LD -o .build_release/lib/libopenpose.so.1.0.0-rc3
CXX/LD -o .build_release/examples/tutorial_pose/2_extract_pose_or_heatmat_from_image.bin
.build_release/lib/libopenpose.so: undefined reference to `cv::VideoCapture::VideoCapture(cv::String const&)'
.build_release/lib/libopenpose.so: undefined reference to `cv::VideoCapture::set(int, double)'
.build_release/lib/libopenpose.so: undefined reference to `cv::VideoCapture::release()'
.build_release/lib/libopenpose.so: undefined reference to `cv::VideoCapture::operator>>(cv::Mat&)'
.build_release/lib/libopenpose.so: undefined reference to `cv::VideoWriter::VideoWriter(cv::String const&, int, double, cv::Size_<int>, bool)'
.build_release/lib/libopenpose.so: undefined reference to `cv::VideoCapture::isOpened() const'
.build_release/lib/libopenpose.so: undefined reference to `cv::VideoCapture::get(int) const'
.build_release/lib/libopenpose.so: undefined reference to `cv::VideoCapture::VideoCapture(int)'
.build_release/lib/libopenpose.so: undefined reference to `cv::VideoCapture::~VideoCapture()'
.build_release/lib/libopenpose.so: undefined reference to `vtable for cv::VideoWriter'
collect2: error: ld returned 1 exit status
Makefile:492: recipe for target '.build_release/examples/tutorial_pose/2_extract_pose_or_heatmat_from_image.bin' failed
make: *** [.build_release/examples/tutorial_pose/2_extract_pose_or_heatmat_from_image.bin] Error 1
make: *** Waiting for unfinished jobs....
------------------------- -------------------------
Errors detected. Exiting script. The software might have not been successfully installed.
------------------------- -------------------------
Please help me get rid of this.
Thanks
This could be because libopencv_video and/or libopencv_videoio has not been added to the project. If you build opencv from source, do check whether these libraries have been built.
It looks like you did not check the OpenCV3 flag in both the OpenPose and Caffe makefiles.config files.
E.g., if you are using manual compilation as you indicated, assume you have Ubuntu 16 and CUDA 8. So you need to modify both these files:
https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/Makefile.config.Ubuntu16.example
https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/3rdparty/caffe/Makefile.config.Ubuntu16.example
By uncommenting # OPENCV_VERSION := 3 in both of them.
After that simply run again the command they specify: cp Makefile.config.Ubuntu16.example Makefile.config
And make clean in both OpenPose and Caffe and re-build it again.

undefined reference to symbol 'pthread_rwlock_wrlock##GLIBC_2.2.5' in azure storage c++ sdk compilation

I am trying to compile Azure storage c++ SDK on Fedora 22. I am using gcc version 5.1.1-1. When I compile test application using following command:
$> CASABLANCA_DIR=/source/codebox/azure/cpprestsdk/ CXX=g++ cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=on
$> make
It produces following error message:
/usr/bin/ld: CMakeFiles/azurestoragetest.dir/main.cpp.o: undefined reference to symbol 'pthread_rwlock_wrlock##GLIBC_2.2.5'
/usr/lib64/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
tests/CMakeFiles/azurestoragetest.dir/build.make:879: recipe for target 'Binaries/azurestoragetest' failed
make[2]: *** [Binaries/azurestoragetest] Error 1
CMakeFiles/Makefile2:125: recipe for target 'tests/CMakeFiles/azurestoragetest.dir/all' failed
make[1]: *** [tests/CMakeFiles/azurestoragetest.dir/all] Error 2
Makefile:126: recipe for target 'all' failed
make: *** [all] Error 2
I can see libpthread.so.0 library in /usr/lib64 directory. Which other library I need to install?
Add the right find_package invokation to your CMakeLists.txt:
find_package(Threads)
Then, link the library to your target:
target_link_libraries(my_target ${CMAKE_THREAD_LIBS_INIT})
That's all. Likely you forgot the target_link_libraries.
In general (outside of CMake and Azure Storage SDK), this error indicates you need to link with -lpthread. (With gcc you likely want -pthread.)

"Undefined reference to `avcodec_alloc_frame" Error when compile and install Opencv on linux

I am compiling and installing OpenCV using the steps in http://docs.opencv.org/2.4/doc/tutorials/introduction/linux_install/linux_install.html
But during "making" it, it has error when it reaches 45%. The error message is
...
[ 43%] Built target pch_Generate_opencv_video
[ 44%] Built target opencv_video
[ 44%] Built target opencv_perf_video_pch_dephelp
[ 45%] Built target pch_Generate_opencv_perf_video
Linking CXX executable ../../bin/opencv_perf_video
../../lib/libopencv_videoio.so.3.1.0: undefined reference to `avcodec_alloc_frame'
../../lib/libopencv_videoio.so.3.1.0: undefined reference to `avcodec_encode_video'
collect2: error: ld returned 1 exit status
make[2]: *** [bin/opencv_perf_video] Error 1
make[1]: *** [modules/video/CMakeFiles/opencv_perf_video.dir/all] Error 2
make: *** [all] Error 2
I downloaded and installed the latest version of ffmpeg from https://www.ffmpeg.org/.
Anyone knows how can I fix the errors?
Thank you.

Resources