[ENet-discuss] static linking warning

ingmar wirths ingmania at googlemail.com
Tue Mar 29 08:11:09 PDT 2011


Thanks Nuno, that brought me on the right track. The compiler seems the
prefer the dynamic library, when in doubt. I copied libenet.a to another
directory and gave that to the compiler, and i omited the -static switch.
Now everything works just fine.

2011/3/29 Nuno Silva <little.coding.fox at gmail.com>:
> The problem there is that you're statically linking everything instead of
> just enet. However, if libenet.a exists but there is no libenet.so, then the
> library itself should already be static, so you dont need the -static
> switch. Otherwise, I'm sure there's a way to compile libenet.a as a static
> library.
>
> On Tue, Mar 29, 2011 at 3:41 PM, ingmar wirths <ingmania at googlemail.com>
> wrote:
>>
>> Hi all,
>>
>> i'm linking enet statically to my application (with the g++ switch
>> -static),
>> which gives me the following pesky warnings:
>>
>> enet-1.3.1/.libs/libenet.a(unix.o): In function `enet_address_get_host':
>> /home/ingmar/Desktop/enet-1.3.1/unix.c:137: warning: Using
>> 'gethostbyaddr_r' in statically linked applications requires at
>> runtime the shared libraries from the glibc version used for linking
>> enet-1.3.1/.libs/libenet.a(unix.o): In function `enet_address_set_host':
>> /home/ingmar/Desktop/enet-1.3.1/unix.c:84: warning: Using
>> 'gethostbyname_r' in statically linked applications requires at
>> runtime the shared libraries from the glibc version used for linking
>>
>> This looks to me like it's going to be a problem to distribute my
>> application
>> in binary form (which i intend to do). Is static linking not recommended?
>> I guess i won't have this problem when i throw enet directly into my
>> project.
>> Is that the recommended way?
>>
>> I don't want to have any dependencies for my application, that's why i
>> don't
>> want to link dynamically.
>>
>> Cheers,
>> ingmar
>> _______________________________________________
>> ENet-discuss mailing list
>> ENet-discuss at cubik.org
>> http://lists.cubik.org/mailman/listinfo/enet-discuss
>
>
> _______________________________________________
> ENet-discuss mailing list
> ENet-discuss at cubik.org
> http://lists.cubik.org/mailman/listinfo/enet-discuss
>
>


More information about the ENet-discuss mailing list