Mail Archives: djgpp/2000/02/10/14:35:14
On Thu, 10 Feb 2000 Riddler02 AT aol DOT com wrote:
> gcc -Lc:/djgpp/lib -o medieval.exe medieval.o -lalleg -lmaps -lstdcx
Assuming that your library is called libmaps.a and that it resides in
c:/djgpp/lib, the above command line is correct.
> Then, the error message(s) I get:
>
> Error: medieval.o: in function 'main':
> medieval.cpp(126) Error:undefined reference to
> viewport_class::Move_Viewport_X(int)
Perhaps the library was created incorrectly. Can you describe what
commands did you use to create libmaps.a?
Another problem might be the declarations of prototypes of those
functions which the linker doesn't find. You need to make sure that the
type of the arguments declared in the source files that you compiled into
the libmaps.a library matches the types of arguments used in prototypes
of these functions visible to the compiler when it compiles the file
medieval.cpp, and also that they match the types of arguments used in the
calls to these functions in medieval.cpp. Otherwise, the linker will
look for functions with the same name, but different argument types.
- Raw text -