To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 1394
1393  |  1395
Subject: 
Re: Statically and Dynamically linking lnp ....
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Sun, 27 Aug 2000 09:06:19 GMT
Viewed: 
1334 times
  
In lugnet.robotics.rcx.legos, Colin Ryan writes:
Regarding the previous posting: Please disregard ...

I figured it out, but thought it may be useful to post
a reply to myself, in case it's ever of use to anyone
else using the same tools:

I forgot to wrap my include in an ' extern "C" ' block.
As I understand it this prevents C++ name mangling from
obscuring calls to pure C comnpiled code ???

Anyway the simple code

extern "C"{
#include "liblnp.h"
}

in my C++ class header file seems to have fixed it for now ;-)


Colin,

The "standard" for doing this is to wrap the extern "C" { and } in #ifdef
__cplusplus clauses. You can see how to do this in most .h files in the include
directory. Especially if it's a .h that may be used in mixed (C/C++) projects.
Means you don't have to worry in the .c/.cc file whether or not to have the
extern "C"{}.

As a side note, I noticed include/rom/system.h had the closing } but no extern
"C" {, so I've fixed that in CVS. Probably not noticed, 'cos no-ones included
it in any C++ programs. 8?)

ROSCO



Message is in Reply To:
  Re: Statically and Dynamically linking lnp ....
 
Regarding the previous posting: Please disregard ... I figured it out, but thought it may be useful to post a reply to myself, in case it's ever of use to anyone else using the same tools: I forgot to wrap my include in an ' extern "C" ' block. As I (...) (24 years ago, 26-Aug-00, to lugnet.robotics.rcx.legos)

3 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR