Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > c code calling self C++ library

Reply
Thread Tools

c code calling self C++ library

 
 
Wang WolfLouis
Guest
Posts: n/a
 
      07-12-2011
Now, I want to use C code calling library which is created by g++,
how could I define the c++ library header file?
it should be extern "C" {

.....

}

?
 
Reply With Quote
 
 
 
 
basileis
Guest
Posts: n/a
 
      07-12-2011
On Jul 12, 11:15*am, Wang WolfLouis <(E-Mail Removed)> wrote:
> Now, I want to use C code calling library which is created *by g++,
> how could I define the c++ library header file?
> it should be extern "C" {
>
> ....
>
> }
>
> ?


Whatever function or variable exposed in extern "C" block can be used
by C source . A function which is declared to have C linkage can use
all the features of C++ but it's parameter and return type should be
accessible from C source from where you are calling this code.
 
Reply With Quote
 
 
 
 
Keith Thompson
Guest
Posts: n/a
 
      07-12-2011
Wang WolfLouis <(E-Mail Removed)> writes:
> Now, I want to use C code calling library which is created by g++,
> how could I define the c++ library header file?
> it should be extern "C" {
>
> ....
>
> }
>
> ?


C++ defines features for C++ code calling C, and C calling
C++. C does not. So a C++ newsgroup will likely get you
better information. But first, take a look at the C++ FAQ,
<http://www.parashift.com/c++-faq-lite/>, particularly section 32.

--
Keith Thompson (The_Other_Keith) http://www.velocityreviews.com/forums/(E-Mail Removed) <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
 
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
Changing self: if self is a tree how to set to a different self Bart Kastermans Python 6 07-13-2008 11:19 AM
__autoinit__ (Was: Proposal: reducing self.x=x; self.y=y;self.z=z boilerplate code) falcon Python 0 07-31-2005 05:41 PM
Re: __autoinit__ (Was: Proposal: reducing self.x=x; self.y=y;self.z=z boilerplate code) Ralf W. Grosse-Kunstleve Python 2 07-12-2005 03:20 AM
Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code Ralf W. Grosse-Kunstleve Python 16 07-11-2005 09:28 PM
__autoinit__ (Was: Proposal: reducing self.x=x; self.y=y;self.z=z boilerplate code) Ralf W. Grosse-Kunstleve Python 18 07-11-2005 04:01 PM



Advertisments