Mail Archives: djgpp/2001/07/06/04:38:20
> From: "Greg K" <iosys AT uswest DOT net>
> Newsgroups: comp.os.msdos.djgpp
> Date: Thu, 5 Jul 2001 11:02:30 -0700
>
> I'm a bit of a newbie, and it seems one can write a whole book on the
> operation compilers.
One can indeed write a book, and some of us actually did, but most
people don't seem to read those books ;-)
(I'm not saying that you didn't read the docs, nor am I saying that
your particular problem is in the docs. But the fact that most
questions here are already covered in the documentation is a serious
dumper on any desire to add more books.)
> When I tried to compile something I copied and pasted
> from the net before (a simple Allegro mode setting app) it gave me a bunch
> of undefined references (I'm compiling at the command line since I don't
> like IDEs).
Please always post the exact text of the error message(s) you get and
the command line used to compile the program. It is hard to help you
without that info.
In this case, since you are trying to use Allegro, I'm guessing that
the undefined references all belong to Allegro functions. If that
guess is correct, it means you either don't have Allegro installed, or
it is installed in some place where the linker cannot find it. Adding
"-v" to the compilation/link line will show you where does the linker
look for libraries.
> I checked the include directory, in the allegro.h file where those
> references are supposed to be located and those references appear to be
> defined there.
The header files only have the functions' prototypes. In contrast,
the linker needs the _body_ (i.e. the code) of those functions, which
is in liballeg.a, the library. You should find out why does the
linker miss the library.
- Raw text -