Need gtk help - compilation does not work

Programming, for all ages and all languages.
Post Reply
Robert

Need gtk help - compilation does not work

Post by Robert »

Hi!

I just tried to compile some code using gtk+ 1.2.
The only gcc-invocation that compiles the code at all was

Code: Select all

gcc (...) `pkg-config --cflags --libs gtk+`
but with this configuration i am not able to use the gnome canvas - i get linker-messages like 'undefined reference to gnome_canvas_new'.
Included headers are <gtk/gtk.h> and <gdk/gdk.h>, but this should be irrelevant, after it is a compiler error.

I also tried this comand:

Code: Select all

gcc(...) `pkg-config --cflags gtk+` \ `pkg-config --libs gtk+`
There i got the error: -L/usr/lib/X11R6/lib does not exist
though the directory it is complaining about does exist.

I read all kind of manuals and articles and chapters of books that i have on the topic, but
1. They all use different commands, headerfiles, versions of gtk to compile
2. Not one of them works (i tried all combinations, the two above are just the ones with the least errors).

I would post my code, if it helps, but after i get linker-errors it should be irrelevant - there must be some problem with the libs...

If someone here works with the same version of the library and knows the solution please tell me!
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Need gtk help - compilation does not work

Post by Pype.Clicker »

what about trying to link to something like
/opt/gnome/lib/libgnome.so ?
Post Reply