chronosynclastic
chronosynclastic

Reputation: 1675

GTK: undefined reference to `cairo_surface_set_device_scale'

I'm trying to install a software called bgslibrary with GUI (QT). cmake generates the build files without a problem. But when I do make, I get the following error related to libgtk andcairo:

/usr/lib/x86_64-linux-gnu//libgtk-3.so.0: undefined reference to `cairo_surface_set_device_scale'

I'm using Ubuntu 16.04 with gcc 5.4.1, I also have Anaconda installed as Python distribution. I googled a bit and found out that some people solved the problem by removing their $HOME/anaconda/lib directory from LD_LIBRARY_PATH because somehow Anaconda might be interfering with thegtk libraries. I tried this but it didn't work for me.

I also checked the versions and symlinks of libgtk and cairo on my system.

/usr/lib/x86_64-linux-gnu//libgtk-3.so.0 -> libgtk-3.so.0.1800.9

and sudo apt-get install libcairo2-dev yields:

libcairo2-dev is already the newest version (1.14.6-1).

Could there be a mismatch between the libgtk and cairo versions? I remember encountering this error also for other softwares that required gtk so I was wondering if anyoned had similar issues. Thanks!

Upvotes: 2

Views: 1897

Answers (1)

Haim-Zvi
Haim-Zvi

Reputation: 11

I also have the same error either in gedit & eclipse.

The solution was changing the LD_LIBRARY_PATH to use

libcairo-script-interpreter.so.2 -> libcairo-script-interpreter.so.2.11512.0

libcairo.so.2-> libcairo.so.2.11512.0

instead of version 11200 of libcairo-script-interpreter and libcairo which couse the problem

libcairo-script-interpreter.so.2 -> libcairo-script-interpreter.so.2.11200.18

libcairo.so.2 -> libcairo.so.2.11200.18

Upvotes: 1

Related Questions