Mail Archives: djgpp/1998/10/26/12:58:18
> In order to succesfully compile the included demo program, I had to
> actually add the library filename to the command line, as so:
>
> gcc -o playmp3.exe playmp3.o libamp.a -lalleg -lamp
...
> which looks to me like somehow Allegro wasn't getting linked properly.
> If 'libamp.a' isn't specified in the above command line, the same errors
> occur.
That is because djgpp uses a one-pass linker. It only goes through
the libraries once, including whatever functions it needs from them.
So when your program calls libamp, which in turn calls parts of
Allegro, you must put your program first, then libamp, then Allegro.
> Using a similar approach on my program, I still get the unresolved
> function errors.
I suspect that this is a different, unrelated problem. You mentioned
that you are programming in C++: if so, have you got an extern "C"
wrapper around the function prototypes in libamp.h? That is required
whenever you want to call C functions from C++ code, and seems like
the most likely cause for your link errors.
Shawn Hargreaves.
- Raw text -