Problem with dhcpctl.

Randall C Grimshaw rgrimsha at syr.edu
Tue Apr 21 16:27:30 UTC 2009


I was playing with this last week under Mandriva and discovered that the order of the includes does make a difference.
I had to start again using the example from the man pages and here is what I used to get it working. I know it seems a bit of a hack but there is something broken, and I have not played with it since.

           #include <stdlib.h>
           #include <stdarg.h>
           #include <sys/time.h>
           #include <sys/socket.h>
           #include <stdio.h>
           #include <netinet/in.h>
           #include <string.h>
           #include <isc-dhcp/result.h>
           #include <isc-dhcp/boolean.h>
           #include <isc-dhcp/commandline.h>
           #include <isc-dhcp/dst.h>
           #include <isc-dhcp/formatcheck.h>
           #include <isc-dhcp/int.h>
           #include <isc-dhcp/lang.h>
           #include <isc-dhcp/list.h>
           #include <isc-dhcp/mem.h>
           #include <isc-dhcp/print.h>
           #include <isc-dhcp/string.h>
           #include <isc-dhcp/types.h>
           #include <dhcpctl/dhcpctl.h>
           #include <omapip/omapip_p.h>
           #include <omapip/alloc.h>
           #include <omapip/convert.h>
           #include <omapip/hash.h>
           #include <omapip/omapip.h>
/*           #include <omapip/buffer.h> */
/*           #include <omapip/trace.h>  */

Randy

From: dhcp-users-bounces at lists.isc.org [mailto:dhcp-users-bounces at lists.isc.org] On Behalf Of phil lemelin
Sent: Tuesday, April 21, 2009 10:13 AM
To: Users of ISC DHCP
Subject: Re: Problem with dhcpctl.

Good morning list.

Following yesterday help from Jeremy, I advanced a little bit. I'm now having some link error. Again, same thing under ubuntu or centos. Very sorry if this is obvious but my C is really rusty.

My includes are the following :

#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdarg.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <isc-dhcp/result.h>
#include <isc-dhcp/dst.h>
#include <dhcpctl.h>

The actual error.

[phil at krum tmp]$ gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"dhcpctl_test.d" -MT"dhcpctl_test.d" -o"dhcpctl_test.o" "dhcpctl_test.c"
dhcpctl_test.c: In function 'main':
dhcpctl_test.c:42: warning: implicit declaration of function 'inet_pton'
dhcpctl_test.c:90: warning: implicit declaration of function 'ctime'
dhcpctl_test.c:90: warning: format '%s' expects type 'char *', but argument 3 has type 'int'
dhcpctl_test.c:91: warning: control reaches end of non-void function

[phil at krum tmp]$ gcc -L/usr/lib64 -o"DhcpCtl"  dhcpctl_test.o   -ldhcpctl -ldst -lomapi
/usr/lib64/libomapi.a(connection.o): In function `omapi_connection_output_auth_length':
(.text+0x167): undefined reference to `dst_sig_size'
/usr/lib64/libomapi.a(connection.o): In function `make_dst_key':
(.text+0x335): undefined reference to `dst_buffer_to_key'
/usr/lib64/libomapi.a(connection.o): In function `omapi_connection_sign_data':
(.text+0x3bd): undefined reference to `dst_sign_data'
/usr/lib64/libomapi.a(connection.o): In function `omapi_connection_sign_data':
(.text+0x418): undefined reference to `dst_sig_size'
/usr/lib64/libomapi.a(connection.o): In function `omapi_connection_sign_data':
(.text+0x463): undefined reference to `dst_sign_data'
/usr/lib64/libomapi.a(connection.o): In function `omapi_connection_get_value':
(.text+0x5f8): undefined reference to `dst_sig_size'
/usr/lib64/libomapi.a(connection.o): In function `omapi_connection_get_value':
(.text+0x6ca): undefined reference to `dst_sig_size'
/usr/lib64/libomapi.a(connection.o): In function `omapi_connection_set_value':
(.text+0x7bc): undefined reference to `dst_free_key'
/usr/lib64/libomapi.a(connection.o): In function `omapi_connection_set_value':
(.text+0x8a3): undefined reference to `dst_free_key'
/usr/lib64/libomapi.a(support.o): In function `omapi_init':
(.text+0xa16): undefined reference to `dst_init'
collect2: ld returned 1 exit status

[phil at krum tmp]$ rpm -qf  /usr/lib64/libdhcpctl.a
dhcp-devel-3.0.5-18.el5
[phil at krum tmp]$ rpm -qf  /usr/lib64/libdst.a
dhcp-devel-3.0.5-18.el5
[phil at krum tmp]$ rpm -qf  /usr/lib64/libomapi.a
dhcp-devel-3.0.5-18.el5

[phil at krum tmp]$ rpm -qf /usr/include/dhcpctl.h
dhcp-devel-3.0.5-18.el5
[phil at krum tmp]$ rpm -qf /usr/include/isc-dhcp/dst.h
dhcp-devel-3.0.5-18.el5
[phil at krum tmp]$ rpm -qf /usr/include/isc-dhcp/result.h
dhcp-devel-3.0.5-18.el5


Best regards.

--
Philippe-Alexandre Lemelin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20090421/53a48aa4/attachment.html>


More information about the dhcp-users mailing list