Xref: news2.mv.net comp.os.msdos.djgpp:4732 From: Shawn Hargreaves Newsgroups: comp.os.msdos.djgpp Subject: Re: dumb newbie question: make and allegro library... Date: Sat, 8 Jun 1996 21:36:55 +0100 Organization: The University of York, UK Lines: 32 Message-ID: NNTP-Posting-Host: tower.york.ac.uk Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII In-Reply-To: <31b99e4d.3562626@nntp.ix.netcom.com> To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp > FLAGS = ../lib/liballeg.a -liostream > > dots : colors.cpp > gcc $(FLAGS) colors.cpp References to libraries have to come after the source file they are using. This is because ld is a single-pass linker, so it looks first at the libraries but ignores them because it doesn't have any unresolved symbols. Then it comes to the colors.o file which uses lots of symbols, but by this time it is too late to go back and get them from the library :-) Try something like: CFLAGS = -O -Wall etc. LIBS = ../lib/liballeg.a -liostream dots : colors.cpp gcc $(CFLAGS) colors.cpp $(LIBS) > Points of note: allegro.h is currently contained in ../allegro, > ../include, and the current directory. The allegro directory is even It is liballeg.a that it wasn't finding, not allegro.h. If it couldn't find the header, it wouldn't get as far as the linker... /* * Shawn Hargreaves. Why is 'phonetic' spelt with a ph? * Check out Allegro and FED on http://www.york.ac.uk/~slh100/ */