Mail Archives: djgpp/1996/06/08/20:14:53
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 -