Hello,
i would like to implement dhcpctl in a program to manipulate dhcp leases.
It doesn't work and there are errors at compilation :
/tmp/ccYPRIt5.o: In function `LeaseCleaning(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
pxe.cpp
.text+0x133a): undefined reference to `dhcpctl_initialize()'
pxe.cpp
.text+0x1352): undefined reference to `dhcpctl_connect(__omapi_object**, char const*, int, __omapi_object*)'
collect2: ld returned 1 exit status
Code:
#include <stdarg.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <isc-dhcp/result.h>
#include <dhcpctl.h>
#include <omapip/omapip.h>
dhcpctl_data_string ipaddrstring = NULL;
dhcpctl_data_string value = NULL;
dhcpctl_handle connection = NULL;
dhcpctl_handle lease = NULL;
isc_result_t waitstatus;
struct in_addr convaddr;
time_t thetime;
dhcpctl_initialize ();
dhcpctl_connect (&connection, "127.0.0.1", 9991, 0);
//hcpctl_new_object (&lease, connection, "lease");
g++ -o /home/ff/pxe /home/ff/pxe.cpp -I/usr/include/libxml2 -ldhcpctl -lomapi -ldst