Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > c interface with c++ implementation

Reply
Thread Tools

c interface with c++ implementation

 
 
zade
Guest
Posts: n/a
 
      06-28-2007
I want to create a library with c interface but with c++
implementation. But I don't know if there exist some potential
problems.
Any advice? thanks!

 
Reply With Quote
 
 
 
 
Keith Thompson
Guest
Posts: n/a
 
      06-28-2007
zade <> writes:
> I want to create a library with c interface but with c++
> implementation. But I don't know if there exist some potential
> problems.
> Any advice? thanks!


C doesn't define an interface to C++.

C++, however, does define an interface to C, using 'extern "C"'.

So despite the fact that your question has to do with both C and C++,
comp.lang.c++ is the right place to ask it.

--
Keith Thompson (The_Other_Keith) kst- <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
 
Reply With Quote
 
 
 
 
Barry Schwarz
Guest
Posts: n/a
 
      06-28-2007
On Wed, 27 Jun 2007 17:40:42 -0700, zade <>
wrote:

>I want to create a library with c interface but with c++
>implementation. But I don't know if there exist some potential
>problems.
>Any advice? thanks!


Ask in a newgroup where your compilers are topical.


Remove del for email
 
Reply With Quote
 
Malcolm McLean
Guest
Posts: n/a
 
      06-28-2007

"zade" <> wrote in message
news: oups.com...
>I want to create a library with c interface but with c++
> implementation. But I don't know if there exist some potential
> problems.
> Any advice? thanks!
>

No real problems. You need to declare every function you export as "extern
C" in C++, and of course not overload or use other C++ specials.
You will need a C++ compiler to compile the C++ source, of course.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Insertion Sort : C++ implementation 100 times slower than C implementation sanket C++ 7 11-03-2011 05:00 AM
Knowing the implementation, are all undefined behaviours become implementation-defined behaviours? Michael Tsang C Programming 54 03-30-2010 07:46 AM
Knowing the implementation, are all undefined behaviours become implementation-defined behaviours? Michael Tsang C++ 32 03-01-2010 09:15 PM
Program to an interface not an implementation? Will Java 3 09-22-2005 04:05 PM
interface implementation and binary compability Maciek Zywno Java 0 02-19-2004 05:40 PM



Advertisments