Re: [gtk-list] compile problems

"M. Rosencrantz" <> writes:

> Hello, I am trying to build the hello world program described in the
> tutorial document.  I am having some trouble however.  I am sure I am
> doing something really stupid, as I am new to linux programming.

I think I know what your problem is.  I had a similar difficulty a
couple of weeks ago when I first started messing with Gtk seriously.
It turns out that the Makefile on the web page is not quite right.  I
sent the fix below to the web page maintainer, but didn't hear back,
so here it again is for anyone interested:

Subject: Correction/enhancement to helloworld Makefile
Mime-Version: 1.0 (generated by tm-edit 7.105)
Content-Type: text/plain; charset=US-ASCII
From: Rob Browning <>
Date: 20 Jul 1997 22:56:13 -0500
Message-ID: <>
X-Mailer: Gnus v5.4.63/Emacs 19.34
Lines: 31
Xref: misc-mail:3117

This is in regard to the helloworld Makefile on the Gtk documentation
web page.

The main change I made was to make sure that the .o file is handed to
the linker before the rest of the libraries.  Some versions (newer
ones under Linux) have problems otherwise.  I also added the GTK_BASE
variable which makes changing the install dir a little easier.

Here's the whole thing if you're interested.


X11_LIB = -L/usr/X11R6/lib
CC = gcc -g -Wall
LOADLIBES = -lgtk -lgdk -lglib -lX11 -lXext -lm

OBJS = helloworld.o

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

	rm -f *.o *~ helloworld


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