|
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. It's dirty because you'll still need to keep the
existing liblnp.h around as it's referenced in stub.c. It is of course bad
programming practice to have two copies of something more or less identical
around and you really should read a book on C++. That one you bought, for
example. But hey, it's 1.45 am and it finally works :)
Tim
|
|
Message has 1 Reply: | | Re: Winliblnp problems
|
| (...) 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 (22 years ago, 10-Sep-02, to lugnet.robotics.rcx.legos)
|
Message is in Reply To:
| | Winliblnp problems
|
| Hi all, 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. First, I tried compiling it on its own - no joy (...) (22 years ago, 6-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
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|