Jane Young wrote:

I just added #include <gtk/gtk.h> in my .c file and made some changes to makefile, (please find my makefile as attached) The problem comes out when I was trying to compile the program. It gives errors like:
gcc -g -c -I../include -Dhuge=-DLIT_ENDIAN -DINT=short -Di386 -static -DLINUX -DNDEBUG display.c
gcc -g -c -I../include -Dhuge=-DLIT_ENDIAN -DINT=short -Di386 -static -DLINUX -DNDEBUG imgred..c
gcc -static -g -w -L /usr/X11R6/lib -Wall -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -o display display.o imgred.o 'pkg-config gtk+-2.0 --libs' ..lib/util.a ../lib/libcasi.a -lX11 -ldl -lm -lpthread
/usr/bin/ld: cannot find -lgtk-x11-2.0
collect2: ld returned 1 exit status
make: ***[display] Error 1


Look at your {system}/lib subdirectory for libgtk-x11-2.0.so*. There should be a symlink to the actual lib (ie. libgtk-x11-2.0.so.0.200.2) from libgtk-x11-2.0.so. If you have the actual file (and not the symlink), depending on your package system you should either do a 'ldconfig -v' as root to create the symlink (if you installed it from the source tar ball) or install the "devel" package (ie. gtk2-devel on RedHat, if you happen to use a more sophisticated package system for installing).

Linking problems, like the one you're experiencing, are general programming problems as opposed to being library-specific.
--


*Richard Plana, B.Sc., CCNA*
Linux Junkie




Reply via email to