[ENet-discuss] Enet Installation and C++

Marcin Simonides marcin at studio4plus.com
Mon Jun 13 07:57:49 PDT 2005


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"


More information about the ENet-discuss mailing list