delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/09/14:18:29

From: "mephisto" <mephisto AT cloudnet DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: changing from C to C++
Date: 9 Dec 97 01:14:56 GMT
Organization: Cloudnet
Lines: 23
Message-ID: <01bd0441$6b295c60$ecdcc7c7@suzie>
NNTP-Posting-Host: news.cloudnet.com
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

The problem you are having involves name bashing in c++.
In order to keep overloaded functions straight, C++ will do stuff like
this:

void foo(int c, unsigned int h)
void foo(char *c)

foo is changed to _foo__FiUi and _foo__FPc, so It knows what foo you refer
to. If there is a C function, instead of recompiling just use this code.

#ifndef __cplusplus
extern "C" {
#endif
	void foo(char *c);
#ifndef __cplusplus
}
#endif

the extern "C" part of it tells it to look for _foo instead of _foo_FPc.

Hope this helps.

-Meph

- Raw text -


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