I’m trying to compile skeltrack according to this guide http://tayyabnaseer.blogspot.com.tr/2012/05/installing-skeltrack-on-ubuntu.html
I successfully compiled and installed first two libraries. However when it comes to skeltrack I get followin compilation error:
CCLD test-skeleton /usr/bin/ld: test-skeleton.o: undefined reference to symbol 'g_file_read' /usr/lib/i386-linux-gnu/libgio-2.0.so.0: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status
I am on Ubuntu 13.10 32 bit platform. I searched for the error on the net and I came to conclusion that my glib 2.32 doesn’t contain that functions. I successfully compiled and installed glib 2.38. But linker is looking for old glib 2.32 library. Here are libgio libraries in my computer:
locate libgio-2.0.so.0 /home/****/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libgio-2.0.so.0 /home/****/.local/share/Steam/ubuntu12_32/steam-runtime/amd64/usr/lib/x86_64-linux-gnu/libgio-2.0.so.0.3200.3 /home/****/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libgio-2.0.so.0 /home/****/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libgio-2.0.so.0.3200.3 /home/****/Downloads/ubuntu-core-13.04-core-i386/usr/lib/i386-linux-gnu/libgio-2.0.so.0 /home/****/Downloads/ubuntu-core-13.04-core-i386/usr/lib/i386-linux-gnu/libgio-2.0.so.0.3600.0 /home/****/install/lib/libgio-2.0.so.0 /home/****/install/lib/libgio-2.0.so.0.3800.2 /usr/lib/i386-linux-gnu/libgio-2.0.so.0 /usr/lib/i386-linux-gnu/libgio-2.0.so.0.3800.1 /usr/local/lib/libgio-2.0.so.0 /usr/local/lib/libgio-2.0.so.0.3600.0 /usr/local/lib/libgio-2.0.so.0.3800.2
How can I tell the linker to use correct libgio that it is looking for?
Advertisement
Answer
I figured out how to link a specific library after looking at following weblinks:
- How to add a path to LDFLAGS
- How to use ldflags while running configure
- How to link a specific version of a shared library in makefile without using LD_LIBRARY_PATH?
- How to specify the library version to use at link time?
- How do you link to a specific version of a shared library in GCC
Specifically, setting LDFLAGS
as,
LDFLAGS='-l:/usr/local/lib/libgio-2.0.so.0.3800.2 -l:/usr/local/lib/libgobject-2.0.so.0.3800.2 -l:/usr/local/lib/libglib-2.0.so.0.3800.2' ./configure
did the trick.