LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Help with gtk+ (https://www.linuxquestions.org/questions/linux-newbie-8/help-with-gtk-242728/)

doody 10-14-2004 05:49 PM

Help with gtk+ (solved)
 
I'm using slackware, and it came with two versions of gtk+.

Here's what's in /var/log/packages:

gtk+-1.2.10-i386-3
gtk+2-2.4.3-i486-1

gtk-config is installed and is located at /usr/bin/gtk-config


I'm trying to compile a small gtk+ example from a book, and I'm getting the following errors:



Code:

@dev:/home/dev/Projects/Gtk+/learning# gcc -Wall a.c -o a `gtk-config --cflags --libs`
a.c: In function `main':
a.c:56: warning: implicit declaration of function `g_signal_connect'
a.c:56: warning: implicit declaration of function `G_OBJECT'
a.c:57: warning: implicit declaration of function `G_CALLBACK'
a.c:80: warning: implicit declaration of function `g_signal_connect_swapped'
/tmp/ccwuOYm6.o(.text+0x80): In function `main':
: undefined reference to `G_CALLBACK'
/tmp/ccwuOYm6.o(.text+0x91): In function `main':
: undefined reference to `G_OBJECT'
/tmp/ccwuOYm6.o(.text+0x9a): In function `main':
: undefined reference to `g_signal_connect'
/tmp/ccwuOYm6.o(.text+0xac): In function `main':
: undefined reference to `G_CALLBACK'
/tmp/ccwuOYm6.o(.text+0xbd): In function `main':
: undefined reference to `G_OBJECT'
/tmp/ccwuOYm6.o(.text+0xc6): In function `main':
: undefined reference to `g_signal_connect'
/tmp/ccwuOYm6.o(.text+0x113): In function `main':
: undefined reference to `G_CALLBACK'
/tmp/ccwuOYm6.o(.text+0x124): In function `main':
: undefined reference to `G_OBJECT'
/tmp/ccwuOYm6.o(.text+0x12d): In function `main':
: undefined reference to `g_signal_connect'
/tmp/ccwuOYm6.o(.text+0x13b): In function `main':
: undefined reference to `G_OBJECT'
/tmp/ccwuOYm6.o(.text+0x14c): In function `main':
: undefined reference to `G_CALLBACK'
/tmp/ccwuOYm6.o(.text+0x15d): In function `main':
: undefined reference to `G_OBJECT'
/tmp/ccwuOYm6.o(.text+0x166): In function `main':
: undefined reference to `g_signal_connect_swapped'
collect2: ld returned 1 exit status

I'm thinking this is because gtk-config is returning the older version of gtk. I'm lost as to how to fix this though. I've been searching google for the last 45 minutes or so without any luck. Any info/advice would be hugely appreciated.

doody 10-14-2004 05:55 PM

OK, the problem is definitely gtk-config returning version 1.2 of gtk because I just succesfully compiled a small hello world application using 1.2. I'm not sure where to go from here though....

doody 10-14-2004 09:58 PM

I figured it out by taking a look at a makefile produced by MinGW. I need to use:

`pkg-config --cflags --libs gtk+-2.0`

and not:

`gtk-config`

I do wish _someone_ would have replied though... oh well =)


All times are GMT -5. The time now is 05:43 PM.