LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   gtk+ make error in libgio - undefined reference (https://www.linuxquestions.org/questions/linux-software-2/gtk-make-error-in-libgio-undefined-reference-785864/)

konzo 01-30-2010 02:22 PM

gtk+ make error in libgio - undefined reference
 
Hi all,

I am trying to install gtk+-2.19.0 - latest stable lib version (needed for installation of wxWidgets and then for codeblocks).

./configure runs with no errors, but make give these errors:

Code:

/usr/local/lib/libgio-2.0.so: undefined reference to `g_ptr_array_new_with_free_func'                 
/usr/local/lib/libgio-2.0.so: undefined reference to `g_error_new_valist'                             
/usr/local/lib/libgio-2.0.so: undefined reference to `g_poll'
./.libs/libgtk-x11-2.0.so: undefined reference to `g_array_unref'
/usr/local/lib/libgio-2.0.so: undefined reference to `g_hostname_is_non_ascii'
/usr/local/lib/libgio-2.0.so: undefined reference to `g_hostname_to_ascii'
/usr/local/lib/libgio-2.0.so: undefined reference to `g_mkstemp_full'
/usr/local/lib/libgio-2.0.so: undefined reference to `g_array_get_type'
/usr/local/lib/libgio-2.0.so: undefined reference to `g_byte_array_unref'
./.libs/libgtk-x11-2.0.so: undefined reference to `g_mapped_file_unref'
/usr/local/lib/libgio-2.0.so: undefined reference to `g_byte_array_get_type'
./.libs/libgtk-x11-2.0.so: undefined reference to `g_array_get_element_size'
/usr/local/lib/libgio-2.0.so: undefined reference to `g_main_context_get_thread_default'
collect2: ld returned 1 exit status
make[4]: *** [gtk-query-immodules-2.0] Error 1
make[4]: Leaving directory `/home/kode/3downloads/1junk/gtk+-2.19.0/gtk'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/kode/3downloads/1junk/gtk+-2.19.0/gtk'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/kode/3downloads/1junk/gtk+-2.19.0/gtk'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/kode/3downloads/1junk/gtk+-2.19.0'
make: *** [all] Error 2


Any suggestion?

ozanbaba 01-30-2010 02:49 PM

do you use system glib?
i think it does not like the glib you got.

konzo 01-30-2010 02:52 PM

I installed glib 2.23. The system glib was 18.4

ozanbaba 01-30-2010 02:53 PM

did you remove the system's glib?

GrapefruiTgirl 01-30-2010 02:55 PM

I've recently been building some GTK and related stuff, and have found that it helps to specifically tell the build where to find stuff, because for some reason, even when the required libs and headers are in the right location, the build can't seem to find it.

Make sure your $LDFLAGS contains the correct location(s) of your lib dir (-L/usr/lib or -L/usr/local/lib or whatever) and it may help too, to export your CPPFLAGS before running the build, like:
Code:

export CPPFLAGS="${CPPFLAGS} -I/usr/include/gtk+-2.0 -I/usr/include/glib-2.0 -I/usr/include/pango-1.0"
and put the correct /include dirs for where glib and other "hard-to-find" items are.

konzo 01-30-2010 03:10 PM

ozanbaba,

I didn't know how to remove system glib so i download 18.4 source, configure and then run
make uninstall
make clan
make distclean
and then install 2.23 version.

GrapefruiTgirl,
I missed the env. variables from the site of gtk++
http://library.gnome.org/devel/gtk/u...-building.html
now I export them and trying to configure, make and make install again...

ozanbaba 01-30-2010 03:11 PM

as root slackpkg remove glib2 will remove glib package

konzo 01-30-2010 03:26 PM

Thank you that works correct. 18.4 version was still on the system.
Start from beginning...

ozanbaba 01-30-2010 03:30 PM

linker got confused. however what GrapefruiTgirl said makes sense, too as with it you can keep two versions of glib on the system: stock Slackware package and new beta package.

konzo 01-30-2010 03:50 PM

Why after installing glib 2.23 from source it cant be slackpkg remove, install update or anything?

ozanbaba 01-30-2010 04:00 PM

Quote:

Originally Posted by konzo (Post 3846496)
Why after installing glib 2.23 from source it cant be slackpkg remove, install update or anything?

no you can't

however creating a Slackware package is pretty simple compared to other systems.

Code:

su
chown -R root:root .
find . \
 \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
 -exec chmod 755 {} \; -o \
 \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
 -exec chmod 644 {} \;

CFLAGS="-O2 -march=i486 -mtune=i686= CXXFLAGS="-O2 -march=i486 -mtune=i686" ./configure --prefix=/usr --libdir=/usr/lib --sysconfdir=/etc --localstatedir=/var --mandir=/usr/man --docdir=/usr/doc/glib2-2.23 --build=i486-slackware-linux
make
mkdir -p /tmp/pkg-glib2
make install DESTDIR=/tmp/pkg-glib2
cd /tmp/pkg-glib2
/sbin/makepkg -l y -c n /tmp/glib2-2.23-i486-1_none.tgz


however best way to go is using Patrick's build script in source folder of the dvd (or source cd).

and of course you car do make uninstall

konzo 01-31-2010 02:08 AM

Things goes messed up and I restore from previous day's backup. Now I am trying to build C::B within C::B using CodeBlocks-unix.cbp but have some errors. I am closing this thread as solved since I was opened similar:

http://www.linuxquestions.org/questi...3/#post3845907

Many thanks to ozanbaba and GrapefriuTgirl - I get valuable lesson from both of you.


All times are GMT -5. The time now is 12:16 AM.