0
Can you please tell me how can I resolve this 'undefined reference' error when linking on Ubuntu 10.10
conftest.c:(.text+0x4): undefined reference to `glib_major_version'
conftest.c:(.text+0xd): undefined reference to `glib_minor_version'
conftest.c:(.text+0x16): undefined reference to `glib_micro_version'
collect2: ld returned 1 exit status
I have added 'export LD_LIBRARY_PATH=/usr/lib:/lib:$LD_LIBRARY_PATH' to my .bashrc.
$ ls -la libgl*.*
lrwxrwxrwx 1 root root 23 2010-12-17 18:29 libglib-2.0.so.0 -> libglib-2.0.so.0.2600.0
-rw-r--r-- 1 root root 842208 2010-09-27 16:16 libglib-2.0.so.0.2600.0
/lib $ pwd
/lib
But that does not solve the problem. What should I do?
Did you add
-lglib
to your linker options, e.g.gcc -lglib
orld -lglib
orLDFLAGS=-lglib
? – Mikel – 2011-02-02T20:43:31.257Is this your own code, or someone else's? Does it have a
./configure
script? You need to show us what leads up to the error, e.g. what command you are running. – Mikel – 2011-02-02T20:55:18.333