compiling C++ code as C

compiling C++ code as C

Post by Harsha » Sat, 11 Aug 2001 15:18:54



Hi all,

I want to complile, link and make a library (C++) code. I can do this
without any problem for c++ code. But I want this to be done in "C"
style not C++ (I want this to be used by Oracle - it needs C style
parameter passing). Is there a way that I can compile and link C++
code so it end up with "C" style library. I'm using gcc 2.8.1. Also
this code does not have any serious C++ code except that I have few
classes.

Will I have re write everything C ???

Please help

Harshana

 
 
 

compiling C++ code as C

Post by Dan Espe » Sat, 11 Aug 2001 23:19:28



> Hi all,

> I want to complile, link and make a library (C++) code. I can do this
> without any problem for c++ code. But I want this to be done in "C"
> style not C++ (I want this to be used by Oracle - it needs C style
> parameter passing). Is there a way that I can compile and link C++
> code so it end up with "C" style library. I'm using gcc 2.8.1. Also
> this code does not have any serious C++ code except that I have few
> classes.

> Will I have re write everything C ???

Add some "extern C" APIs.

I don't think this is the right newsgroup for this.

--
Dan Espen