delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/07/20/19:00:56

From: lied AT w-lon DOT lucent DOT com (Robert Lied)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Linking Object Libraries
Date: 20 Jul 2000 21:29:33 GMT
Organization: Lucent Technologies, Naperville, Illinois, USA
Lines: 20
Message-ID: <8l7qvt$e8@ssbunews.ih.lucent.com>
References: <3977519D DOT 1545FF4C AT puckbell DOT net>
NNTP-Posting-Host: w-lied.ih.lucent.com
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

In article <3977519D DOT 1545FF4C AT puckbell DOT net>,
Tasci Synx  <nospam AT puckbell DOT net> wrote:
>Hello, I was wondering if anyone might be able to help me.  I compiled a
>number of object files, then used the 'ar' utility to make a single file
>out of them called libgame.a.  I tried to include this with the my
>object files in another project, but received an error every time I
>tried to call a function in the library.  It was as though there was no
>library in the first place.  

Since changing the order of files listed didn't help,
is there perhaps some confusion about functions that need
to be declared extern "C"?  If the library was compiled with
gcc (not gpp) as C functions, then the names won't be mangled
with type information.  The C++ compiler (gpp) will be trying
to find mangled names, unless all the functions are declared
with extern "C".

Even more basic, I assume that the library was compiled
with gcc/gpp.  Object modules from different compilers,
especially C++ object modules, often won't link together.

- Raw text -


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