3

I have set up a video streaming system with OpenCv and Cairo. Unfortunately, now when I attempt to build, I get all sorts of undefined references to libpangocairo-1.0.so.0. I'd like a solution where I can just ignore these undefined references, or explicitly and exclusively point to the correct dependency.

Side note: I am using CMake.

It seems that my system library files are accidentally being queried instead of the user installed dependencies for OpenCv.

Things I have tried:

• Reinstalled libpangocairo

• Changed the LD_LIBRARY_PATH to explicitly point at our cairo library dependency within the repo

• Updated Glib to 2.27 from 2.0 (source said that Cario/OpenCv depends on the a later version of GLibc - I think he actually said 2.39, which doesn't exist :white_frowning_face:)

• Updated GTK to 3.0 which also contains glib and would install its most recent version

• Copied libpangocairo from /usr/lib to our repositories dependencies (build points correctly to the newly located lib but still same error)

• Completely wiped my environment and set up environment from scratch

Error Message:

//usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0: undefined reference to `cairo_ft_scaled_font_unlock_face'
//usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0: undefined reference to `cairo_ft_font_options_substitute'
//usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0: undefined reference to `cairo_ft_font_face_create_for_pattern'
//usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0: undefined reference to `cairo_ft_scaled_font_lock_face'
collect2: error: ld returned 1 exit status
  • 1
    Those are undefined references *from* `libpangocairo-1.0.so.0`, not *to* it. Your link stage is pulling in that Cairo library, and as a consequence it needs to resolve those references in order to produce a functioning executable. Ignoring is not an option. – JaMiT May 16 '19 at 18:42
  • What is the linker's command line? (It might be shown shortly before these messages, starting with `ld` and possibly extending over multiple lines.) Which version of Cairo are you trying to link against? Why is this version in your repo instead of installed normally? – JaMiT May 16 '19 at 18:46
  • @JaMiT, - "intstead of installed normally" - you mean stored in /usr/local/lib? Or something else? Pretty sure we're installing it within our own repository to allow for cross-compilation. We use rpath to set the path to the library directories contained within the repository. - The Cairo version is 1.16.0. - There does not appear to be any information on the command line regarding ld. This is the last command, followed by rpath references to the relevant libraries: /usr/bin/cmake -E cmake_link_script CMakeFiles/od2_demo.dir/link.txt --verbose=1 /usr/bin/g++ -O3 -DNDEBUG – keith davis May 17 '19 at 10:17
  • You seem to have your own version of cairo in your project. This version of cairo does not have FreeType support. However, you seem to be also using Pango and that was built for cairo with FreeType support. So... why do you have your own version of cairo in your project anyway? Your system already seems to have cairo available. – Uli Schlachter May 17 '19 at 14:41

0 Answers0