Mail Archives: djgpp/1996/06/09/08:11:43
Thinking furiously, The Great and Powerful Marcus wrote:
>
> FLAGS = ../lib/liballeg.a -liostream
>
> vpath %*.h ../include
>
> dots : colors.cpp
> gcc $(FLAGS) colors.cpp
>
> Yes, there is only one file. Anyway, the make program runs up to the
> ld stage, then spews out about 100 references to undefined functions,
> all of which come from the allegro library.
>
Did you try it this way?
gcc colors.cpp $(FLAGS)
since these are unix-derived tools, and Unix tools expect the library
flags to be AT THE END of the command line (since most linkers are
single-pass linkers), you should try it this way.
Otherwise, you've told it to examine the allegro library BEFORE you
told it to compile colors.cpp, so when it examines the lib, it finds no
items which it needs to extract to satisfy any (at that time) undefined
references, then it compiles the colors.cpp, links in the system
library, runs out of things to link, then discovers a bunch of
unresolved references.
Doing it the other way "accumulates" all the unresolved references
first, then satisfies them by adding in the library.
Fred
--
-------------------------------------------------------------------------------
.---- Fred Smith / Office: fred AT computrition DOT com
( /__ ,__. __ __ / __ : / 508-663-2524
/ / / /__) / / /__) .+' Home: fredex AT fcshome DOT stoneham DOT ma DOT us
/ / (__ (___ (__(_ (___ / :__ 617-438-5471
-------------------------------- Jude 1:24,25 ---------------------------------
- Raw text -