Date: Thu, 10 Feb 2000 17:52:23 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Riddler02 AT aol DOT com cc: djgpp AT delorie DOT com Subject: Re: Linking to my library sucks! Help! In-Reply-To: <24.105b9e3.25d42f1f@aol.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: dj-admin AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk 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.