Re: [gtk-list] Repost: -lgtk -lgdk -lglib -lX11 ??



Borg <vladimip@uniserve.com> writes:

> What linking options do I need to pass to compile a gtk app?

Here's the Makefile I used to compile the simple hello world app.  I
took the sample from the web page and modified it slightly (without
LOADLIBES it was putting the libs in the wrong place on the command
line for my system).  This assumes GNU make (what else is there :>).

GTK_BASE=/usr/local/gtk+

GTK_INCLUDE = -I${GTK_BASE}/include
GTK_LIB = -L${GTK_BASE}/lib
X11_LIB = -L/usr/X11R6/lib
CC = gcc -g -Wall
CFLAGS = $(GTK_INCLUDE)
LDFLAGS = $(GTK_LIB) $(X11_LIB)
LOADLIBES = -lgtk -lgdk -lglib -lX11 -lXext -lm

OBJS = helloworld.o

helloworld: $(OBJS)
# $(CC) $(GTK_LIB) $(X11_LIB) $(OBJS) -o helloworld $(LDFLAGS)

clean:
  rm -f *.o *~ helloworld



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]