opencv: Error when make opencv2 : /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0: undefined reference to `g_option_group_unref'

System information (version)
  • OpenCV => ❔
  • Operating System / Platform => ❔
  • Compiler => ❔
Detailed description

Hi, Like title, when I run ‘make’ in opencv folder, then terminal throw some error : [ 26%] Linking CXX executable …/…/bin/opencv_test_imgproc //usr/lib/x86_64-linux-gnu/libgio-2.0.so.0: undefined reference to g_option_group_unref' //usr/lib/x86_64-linux-gnu/libgio-2.0.so.0: undefined reference to g_thread_pool_move_to_front’ //usr/lib/x86_64-linux-gnu/libgio-2.0.so.0: undefined reference to `g_sequence_is_empty’ collect2: error: ld returned 1 exit status

What should I do ? Thanks . 😄

Steps to reproduce

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 18 (1 by maintainers)

Most upvoted comments

Hey!

I have been struggling with this problem for several days now! I even ended up deleting some libraries, which ended up causing damage to my Ubuntu system. It took me another whole day to fix it! Haha… it was a frustrating experience!

The actual reason behind this issue is that “{$anaconda}/lib/libgio-2.0xxx” has a different version compared to “/usr/lib/{$arch}/libgio-2.0xxx”, and as a result, cmake is unable to locate it. To resolve this, you can try creating a symbolic link. If your error message mentions “/usr/lib/${arch}”, you should remove the libgio-2.0xxx file from that location and create a symbolic link to “{$anaconda}/lib/libgio-2.0xxx” instead.

This solution should work for both OpenCV and OpenPose. If you need further clarification or more details, please feel free to ask. I apologize for any limitations in my English expression.

@yanjunx My problem is solved through another way- (conda install opencv). Thanks for your reply. You are so kind. Thank you!! Will it be available to fix by this way? I also saw a solution of removing libgio-2.0.so.0 from ~/anaconda3/lib/ and copying the same file from /usr/lib/x86_64-linux-gnu/ . The test is running, and… hmm, it seems ok to me.


Ok, I think I passed this bug by the solution I mentioned above.

My hands are shaking… It works;