C dhcpctl linking error
Sztrepka Pál
szpal at szarvas.hu
Thu Dec 13 09:18:36 UTC 2012
2012-12-07 10:59 időpontban Sztrepka Pál ezt írta:
> nnetd.c:(.text.startup+0x1a): undefined reference to
> `dhcpctl_initialize'
> nnetd.c:(.text.startup+0x46): undefined reference to
> `dhcpctl_new_authenticator'
> nnetd.c:(.text.startup+0x6a): undefined reference to
> `dhcpctl_connect'
>
> I compile with this way:
> gcc -Wall -O2 -c -o nnetd.o nnetd.c
> It's ok, object file is created
>
> But, when i try linking whit this command:
> gcc -Wall -O2 -ldhcpctl -lomapi -ldst nnetd.o -o nnetd
> I get the above error.. :-(
Ok, my solution:
1. I compile from source (dhcp-4.2.4-P2)
2. then I copy from ../dhcpd-4.2.4-P2/bind/lib/ the 'libdns.a' and the
'libisc.a' to /usr/local/lib/
(libdhcpctl.a, libomapi.a, libdst.a is also created in this lib
directory after 'make install')
3. and I compile and link my C code this method:
gcc -Wall -O2 nnetd.o /usr/local/lib/libdhcpctl.a
/usr/local/lib/libomapi.a /usr/local/lib/libdst.a
/usr/local/lib/libdns.a /usr/local/lib/libisc.a -o nnetd
I think, this way not so elegant, but my executable (nnetd) is created,
and working..
But I dont't understand why this exe so big? ( 4.9MB!! )
Is there a way to reduce this size?
--
Sztrepka Pál
More information about the dhcp-users
mailing list