delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/02/10/02:11:48

From: Riddler02 AT aol DOT com
Message-ID: <11.fc6abc.25d3b7c8@aol.com>
Date: Thu, 10 Feb 2000 01:42:16 EST
Subject: Linking to my library sucks! Help!
To: djgpp AT delorie DOT com
MIME-Version: 1.0
X-Mailer: AOL 4.0 for Windows 95 sub 38
Reply-To: djgpp AT delorie DOT com

    I know that everybody and their mother has already complained at some 
point about not being about to link to a library, but I really couldn't 
resist - I have read every FAQ and mail archive I could find about the topic, 
yet I can't find any specific answers on how to successfully link programs to 
a library I have created.  
    My library consists of header file, MAPS.H, which defines some constants 
and some classes, and the other file is souce code, MAPS.CPP, which includes 
MAPS.H and defines all of the member functions declared in MAPS.H.  The 
library builds perfectly into LIBMAPS.A.
    However, problems begin when I try linking this library to my game.  The 
game includes MAPS.H, the library is checked off and spelled correctly (minus 
the "lib" part, just "maps") since I'm using RHIDE, it's located in the 
correct directory, and the program compiles fine, but come the linking stage 
I get several "undefined reference" errors of my class member functions that 
are defined in the library.
    I've tried linking the program from the command line and it gives me the 
same errors, so I dont think anything is wrong with RHIDE.  I've tried adding 
the library to my project (instead of checking it off in the Library menu) 
but that didnt do anything.  I'm pretty sure there's nothing wrong with my 
code because if I put the same member function definitions and constants 
directly into my one program source file instead of trying to link to the 
library, the program builds and runs perfectly.
    I'm very stumped and I would hate to continue developing my game having 
to re-compile EVERYTHING each time, so any help that anybody could give would 
be greatly appreciated.  Thanx!

-Kevin
    

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019