www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/06/08/20:14:53

From: j DOT aldrich6 AT genie DOT com
Message-Id: <199606082345.AA089367537@relay1.geis.com>
Date: Sat, 8 Jun 96 23:46:00 UTC 0000
To: djgpp AT delorie DOT com
Mime-Version: 1.0
Subject: Re: dumb newbie question: make

Reply to message 3962396    from BAREN AT IX DOT NETC on 06/08/96 11:59AM


>dots : colors.cpp
>	gcc $(FLAGS) colors.cpp

You have to link the libraries _after_ the program's name, like so:

gcc colors.cpp ../lib/liballeg.a -liostream

The best way to do this is to define $(FLAGS) and $(LINK) separately
and place them separately in the gcc command line, like so:

gcc $(FLAGS) colors.cpp $(LINK)

The reason for this is that ld only makes one pass thru each library it
encounters, only checking for any references that are unresolved
_at that time_.  So by the time it finds your program, it's already perused
the Allegro library and not found anything it needed because it didn't
know about it yet.

John

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019