当前位置:   article > 正文

OpenCV安装报错 libgio-2.0.so.0: undefined reference to `g_source_set_static_name‘_libgio-2.0.so.0 undefined system:g_uri_join

libgio-2.0.so.0 undefined system:g_uri_join

报错信息:

[ 64%] Built target opencv_perf_features2d
[ 65%] Built target opencv_test_imgcodecs
[ 66%] Built target opencv_perf_imgcodecs
[ 66%] Linking CXX executable ../../bin/opencv_test_videoio
/usr/bin/ld: /usr/local/anaconda3/lib/libgio-2.0.so.0: undefined reference to `g_source_set_static_name'
/usr/bin/ld: /usr/local/anaconda3/lib/libgio-2.0.so.0: undefined reference to `g_uri_join'
/usr/bin/ld: /usr/local/anaconda3/lib/libgio-2.0.so.0: undefined reference to `g_uri_split_with_user'
/usr/bin/ld: /usr/local/anaconda3/lib/libgio-2.0.so.0: undefined reference to `g_spawn_async_with_pipes_and_fds'
/usr/bin/ld: /usr/local/anaconda3/lib/libgio-2.0.so.0: undefined reference to `g_uri_split_network'
/usr/bin/ld: /usr/local/anaconda3/lib/libgio-2.0.so.0: undefined reference to `g_uri_is_valid'
/usr/bin/ld: /usr/local/anaconda3/lib/libgio-2.0.so.0: undefined reference to `g_file_set_contents_full'
/usr/bin/ld: /usr/local/anaconda3/lib/libgio-2.0.so.0: undefined reference to `g_memdup2'
/usr/bin/ld: /usr/local/anaconda3/lib/libgio-2.0.so.0: undefined reference to `g_spawn_check_wait_status'
collect2: error: ld returned 1 exit status
make[2]: *** [modules/videoio/CMakeFiles/opencv_test_videoio.dir/build.make:303:bin/opencv_test_videoio] 错误 1
make[1]: *** [CMakeFiles/Makefile2:2478:modules/videoio/CMakeFiles/opencv_test_videoio.dir/all] 错误 2
make: *** [Makefile:166:all] 错误 2

编译器链接错库文件了,真正的库文件在

/lib/x86_64-linux-gnu/libgio-2.0.so.0

库文件的位置可以通过 ldconfig -p | grep libgio 查看 

解决办法:

重命名 /usr/local/anaconda3/lib/libgio-2.0.so.0,编译完成后再改回来

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/185115
推荐阅读
相关标签
  

闽ICP备14008679号