[ENet-discuss] Enet Installation and C++

Charlie Sibbach hubuki.kai at gmail.com
Mon Jun 13 15:07:47 PDT 2005


No good either. We did investigate this as a potential solution; and to be 
thorough I tried it again this morning with all the -L and -l and whatnots. 
Still the same errors. I added this to the "Hello world" program in the 
off-chance that it might work:

extern "C" {
#include <enet.h>
}

I didn't work. I investigated all the enet header files, they already 
include this:

#ifdef _cplusplus // or equivalent, I'm doing this from memory
extern "C" {
#endif
// + same for ending brace

So the C linkage should already be accounted for.
Darn good idea though, thank you!

So, the question is still out there, any other ideas (besides just adding 
and modding all the source to make it part of my project)?

On 6/13/05, Marcin Simonides <marcin at studio4plus.com> wrote:
> 
> 13 Cze 2005 (Poniedziałek) o 10:00 (-0400) Charlie Sibbach napisał(a):
> 
> > Annoying indeed! I tried the -lenet command, at the very end, and it 
> worked
> > with gcc and the C-only version. Well, that's major progress but it's 
> not
> > done yet. I still need to get it working with C++/g++, since that is the
> > language the project is using. I tried your fix with that version and I 
> get
> > the same errors still.
> 
> To use a C library in C++ you need to mark C code for the linker. Google
> for 'extern "C"'.
> 
> Try to wrap enet.h in your project with
> 
> extern "C" {
> 
> [declarations in enet.h]
> 
> }
> 
> Sorry, I don't have time to write more, but this should help you use the
> library (compiled for C) with C++.
> I think you should also be able to compile the library with g++, then
> there sould be no problem with linking with C++.
> --
> Marcin Simonides
> 
> "_The_ Zaphod Beeblebrox?"
> "No, just _a_ Zaphod Beeblebrox; didn't you hear I come in six packs?"
> -- D. Adams, "The Restaurant at the End of the Universe"
> 
> 
> _______________________________________________
> ENet-discuss mailing list
> ENet-discuss at cubik.org
> http://lists.cubik.org/mailman/listinfo/enet-discuss
> 
> 
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.puremagic.com/pipermail/enet-discuss/attachments/20050613/95949cd6/attachment.htm


More information about the ENet-discuss mailing list