Subject:
|
Re: Statically and Dynamically linking lnp ....
|
Newsgroups:
|
lugnet.robotics.rcx.legos
|
Date:
|
Sun, 27 Aug 2000 09:06:19 GMT
|
Viewed:
|
1487 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:
3 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|