|
In lugnet.robotics.rcx.legos, Tim Auton writes:
> From: "Tim Auton" <tim.lugnet@uton.org>
> Sent: Friday, September 06, 2002 4:07 PM
> > I recently downloaded winliblnp, the port by Michael Bunk of liblnp to
> > windows. Exactly what I needed, thanks Michael.
> >
> > Unfortunately, I'm rather new to VC++ and I can't get it to compile [snip]
> > I get the error message
> > CamStandDlg.obj : error LNK2001: unresolved external symbol "enum
> > lnp_init_result __cdecl lnp_init(char *,unsigned short,unsigned
> > char,unsigned char,int)" (?lnp_init@@YA?AW4lnp_init_result@@PADGEEH@Z)
> >
> > Anybody know what I'm missing?
>
> I do, it's a namespace problem, down to you working in a C++ project and
> winliblnp being in C. I suggest a quick and dirty hack of creating a
> duplicate liblnp.h (called, say liblnpcpp.h) with extern "C" in front of all
> the function declarations
The usual method is to put the following near the top of the .h file:
#ifdef __cplusplus
extern "C" {
#endif
and the following at the bottom:
#ifdef __cplusplus
}
#endif
This eliminates the need for 2 .h files. HTH.
ROSCO
|
|
Message is in Reply To:
| | Re: Winliblnp problems
|
| From: "Tim Auton" <tim.lugnet@uton.org> Sent: Friday, September 06, 2002 4:07 PM (...) [snip] (...) I do, it's a namespace problem, down to you working in a C++ project and winliblnp being in C. I suggest a quick and dirty hack of creating a (...) (22 years ago, 10-Sep-02, to lugnet.robotics.rcx.legos)
|
8 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|