error while including header file(dhcp.h) of ISC dhcp-4.2.3 to Cpp file.

Glenn Satchell glenn.satchell at uniq.com.au
Fri Jan 20 07:06:49 UTC 2012


Those include files are part of the source used to build dhcpd and the
clients. If you're modifying the dhcpd server then they are the right
files to use.

If, however, you're writing an app that will only link the libraries
(libdst.a, libomapi.a, libdhcpctl.a) then you should use the include files
in /usr/include:

dhcpctl/dhcpctl.h
isc-dhcp/dst.h
omapip/*.h

regards,
-glenn

>
> Hi,
>                 I have one framework already, i want to include ISC
> dhcp-4.2.3 to the framework. For that i  wrote cpp file
> and header file , when i including dhcpd.h
> Its throwing the below error.
>                 When i remove the header file dhcpd.h, its working fine.
>
>
>
> I have dhcp_server.h , dhcp_server.cpp and one Makefile.
>
>
> consider
> --------------------------
> vi dhcp_server.h
> #include "dhcpd.h"
> .
> .
> .
> .
> .
> My Framework part
> ---------------------------------
>
>
> Consider
> ------------------------
>
> vi dhcp_server.cpp
>  #include <string.h>
>  #include <stdlib.h>
>  #include "dhcp_server.h"
> .
> .
> .
> .
> .
> .
> My framework part
> -----------------------
>
>
> [ameen at csc dhcpd]$ make
> ----- Updating dhcp_server.d
> ----- Compiling dhcp_server.cpp
> In file included from /home/ameen/dhcp-4.2.3/bind/include/dns/tsec.h:50,
>                  from /home/ameen/dhcp-4.2.3/includes/omapip/omapip.h:40,
>                  from /home/ameen/dhcp-4.2.3/dhcpctl/dhcpctl.h:38,
>                  from dhcp_server.h:16,
>                  from dhcp_server.cpp:3:
> /home/ameen/dhcp-4.2.3/bind/include/dst/dst.h:71:1: warning:
> "DST_MAX_ALGS" redefined
> In file included from dhcp_server.h:15,
>                  from dhcp_server.cpp:3:
> /home/ameen/dhcp-4.2.3/includes/isc-dhcp/dst.h:119:1: warning: this is the
> location of the previous definition
> In file included from /home/ameen/dhcp-4.2.3/includes/omapip/isclib.h:64,
>                  from /home/ameen/dhcp-4.2.3/includes/dhcpd.h:95,
>                  from dhcp_server.h:17,
>                  from dhcp_server.cpp:3:
> /home/ameen/dhcp-4.2.3/bind/include/dns/client.h:204: error: parse
>    error before `namespace'
> /home/ameen/dhcp-4.2.3/bind/include/dns/client.h:232: error: parse
>    error before `namespace'
> In file included from /home/ameen/dhcp-4.2.3/includes/dhcpd.h:100,
>                  from dhcp_server.h:17,
>                  from dhcp_server.cpp:3:
> /home/ameen/dhcp-4.2.3/includes/statement.h:69: error: no
>    body nor ';' separates two class, struct or union declarations
> /home/ameen/dhcp-4.2.3/includes/statement.h:69: error: parse
>    error before `add'
> In file included from /home/ameen/dhcp-4.2.3/includes/dhcpd.h:101,
>                  from dhcp_server.h:17,
>                  from dhcp_server.cpp:3:
> /home/ameen/dhcp-4.2.3/includes/tree.h:215: error: parse
>    error before `&&' token
> /home/ameen/dhcp-4.2.3/includes/tree.h:216: error: parse
>    error before `||' token
> /home/ameen/dhcp-4.2.3/includes/tree.h:217: error: parse
>    error before `!' token
> In file included from dhcp_server.h:17,
>                  from dhcp_server.cpp:3:
> /home/ameen/dhcp-4.2.3/includes/dhcpd.h:417: error: no
>    body nor ';' separates two class, struct or union declarations
> /home/ameen/dhcp-4.2.3/includes/dhcpd.h:417: error: parse
>    error before `classes'
> /home/ameen/dhcp-4.2.3/includes/dhcpd.h:507: error: no
>    body nor ';' separates two class, struct or union declarations
> /home/ameen/dhcp-4.2.3/includes/dhcpd.h:507: error: parse
>    error before `billing_class'
> /home/ameen/dhcp-4.2.3/includes/dhcpd.h:898: error: no
>    body nor ';' separates two class, struct or union declarations
> /home/ameen/dhcp-4.2.3/includes/dhcpd.h:898: error: parse
>    error before `class'
> /home/ameen/dhcp-4.2.3/includes/dhcpd.h:965: error: no
>    body nor ';' separates two class, struct or union declarations
> /home/ameen/dhcp-4.2.3/includes/dhcpd.h:965: error: parse
>    error before `classes'
> /home/ameen/dhcp-4.2.3/includes/dhcpd.h:975: error: no
>    body nor ';' separates two class, struct or union declarations
> /home/ameen/dhcp-4.2.3/includes/dhcpd.h:977: error: no
>    body nor ';' separates two
>
>
>
>
>
>
> What would be the problem
> Please provide the solution.
>
> Its throwing an error called parse error ...
> What are all the other files to be included in dhcp_server.h
>
>
> Please let me know
>
> Please do not print this email unless it is absolutely necessary.
>
> The information contained in this electronic message and any attachments
> to this message are intended for the exclusive use of the addressee(s) and
> may contain proprietary, confidential or privileged information. If you
> are not the intended recipient, you should not disseminate, distribute or
> copy this e-mail. Please notify the sender immediately and destroy all
> copies of this message and any attachments.
>
> WARNING: Computer viruses can be transmitted via email. The recipient
> should check this email and any attachments for the presence of viruses.
> The company accepts no liability for any damage caused by any virus
> transmitted by this email.
>
> www.wipro.com
> _______________________________________________
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users





More information about the dhcp-users mailing list