Re: c and C++ together

From: George Greer (
Date: 11/30/00

On Thu, 30 Nov 2000, Mike Redick wrote:

>Ok, I know it can be done... hell I've even done it before!  Just not with
>this compiler.  So how can I get c and C++ files to compile together using
>MSVC++ ver. 6.0?

Compile everything as C++ or C. C++ does name-mangling, C does not.
Therefore, if you compile everything as one or the other, you're set.  You
could also throw:

#ifdef __cplusplus
extern "C" {

int bar(int x);
void foo(void);

#ifdef __cplusplus

Into your headers to tell the C++ compiler what should be called via
C-style functions.  That's only recomended if you can't compile the C stuff
as C++ for whatever reason (external library for instance).

George Greer            | If it's about the CircleMUD mailing list,   | mail instead.

   | FAQ: |
   | Archives: |

This archive was generated by hypermail 2b30 : 04/11/01 PDT