www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/04/15/10:31:25

From: Charles Terry <cterry AT plinet DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Compiling C and C++ in same project
Date: Wed, 15 Apr 1998 07:04:25 -0700
Organization: All USENET -- http://www.Supernews.com
Lines: 27
Message-ID: <3534BE69.4AE2@plinet.com>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 980415160317 DOT 10047C-100000 AT is>
NNTP-Posting-Host: 7920 AT 207 DOT 174 DOT 3 DOT 109
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Eli Zaretskii wrote:
> 
> On 15 Apr 1998, Jason wrote:
> 
> >       I have written some code in C++ and would like to add prewritten code and
> > object files which were written in C.  Unfortunately, when the linker gets
> > hold of the object files compiled under C to be linked with the object file
> > compiled unter C++, I get errors saying that the functions defined in the C
> > modules do not exist (but they really do!).
> 
> > (Also, could someone explain what the difference between
> > object files produced by a C compiler, and object files produced by a C++
> > compiler?).
> 
> There is no difference.

In the context of the problem above.  The function names in a
c++ program are converted- "mangled" in a way that enables the linker
to recognize weather it's a global fuction or class method, the
return type and paramters passed, to facilitate the overloading that
C++ is capable of. C funtions dont need all of that stuff so the
names are not mangled the same way. 

Someday I'll learn to spell weather <sic>

Charles Terry

- Raw text -


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