Re: [gnet] gnet_pack linker error
- From: Tim Müller <t i m zen co uk>
- To: Jasminko Dedic <jasminko85 hotmail com>
- Cc: gnet lists gnetlibrary org
- Subject: Re: [gnet] gnet_pack linker error
- Date: Mon, 26 Dec 2005 14:32:34 +0000
On Sun, 2005-12-25 at 17:55 +0000, Jasminko Dedic wrote:
Hi Jasminko,
> I can't compile code using the gnet_pack or gnet_unpack functions. All other
> work just fine and gnet-programs without gnet_pack or gnet_unpack compile
> and run without any problems.
>
> Error:
> /tmp/cc3qzwM8.o(.text+0x27a): In function `network::sendRequest()':
> : undefined reference to `gnet_pack(char const*, char*, int, ...)'
> collect2: ld returned 1 exit status
> ...
> I'm running Debian Sarge
> libgnet-dev 2.0.7-1
> libgnet2.0-0 2.0.7-1
Indeed, the pack.h header file in 2.0.7 is missing the extern "C" bits
required to make c++ compilers happy. This has been fixed in CVS for a
while. I should be making a new release one of these days, I guess :)
As a work-around, you can do:
#ifdef __cplusplus
extern "C" {
#endif
#include <gnet.h>
#ifdef __cplusplus
}
#endif
If it's a c++ header/source file, you can leave out the #ifdef
__cplusplus of course ;)
Cheers
-Tim
[
Date Prev][Date Next] [
Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]