FW: error when including ISC dhcp-4.2.3 header file(dhcpd.h) to a cpp file.

ameen.shajahan at wipro.com ameen.shajahan at wipro.com
Mon Jan 30 12:24:13 UTC 2012


Hi,
                I have one c file , header file and one Makefile , and including ISC DHCP-4.2.3 libraries and header files in a Makefile.

For eg:

[amin at csc dhcpd_test]$ ls

Makefile  test.c   test.h


Contents inside c file and header file below.
------------------------------------
vi test.c

#include<stdlib.h>
 #include<string.h>
 #include "test.h"
int main(int argc, char **argv)
  {
  return 0;
  }
-----------------------
vi test.h

#include<dhcpd.h>

--------------------------
vi Makefile

 EXECUTABLE = dhcp-server
# Sources
 C_SRCS := $(wildcard *.c)
.
.
.
.
.
.
.
.
-------------------------------

And I compiled,
[amin at csc dhcpd_test]$ make
----- Compiling test.c
test.c: In function `main':
test.c:17: warning: unused parameter `argc'
test.c:17: warning: unused parameter `argv'
----- Linking dhcp-server
[amin at csc dhcpd_test]$ ls
dhcp-server  Makefile  test.c  test.h  test.o
[amin at csc dhcpd_test]$


              [its compiling successfully and create a executable called dhcp-server]




But,When I changed test.c to test.cpp and changing CXX_SRCS := $(wildcard *.cpp) in a Makefile
Its not compiling and throws compilation errors.

[amin at csc dhcpd_test]$ ls
dhcp-server  Makefile  test.cpp  test.h

[amin at csc dhcpd_test]$ make
----- Compiling test.cpp
In file included from /home/amin/csc/dhcp-4.2.3/includes/omapip/isclib.h:64,
                 from /home/amin/csc/dhcp-4.2.3/includes/dhcpd.h:106,
                 from test.cpp:7:
/home/amin/csc/dhcp-4.2.3/bind/include/dns/client.h:213: error: parse
   error before `namespace'
/home/amin/csc/dhcp-4.2.3/bind/include/dns/client.h:241: error: parse
   error before `namespace'
In file included from /home/amin/csc/dhcp-4.2.3/includes/dhcpd.h:114,
                 from test.cpp:7:
/home/amin/csc/dhcp-4.2.3/includes/statement.h:69: error: no
   body nor ';' separates two class, struct or union declarations
/home/amin/csc/dhcp-4.2.3/includes/statement.h:69: error: parse
   error before `add'
In file included from /home/amin/csc/dhcp-4.2.3/includes/dhcpd.h:115,
                 from test.cpp:7:
/home/amin/csc/dhcp-4.2.3/includes/tree.h:215: error: parse
   error before `&&' token
/home/amin/csc/dhcp-4.2.3/includes/tree.h:216: error: parse
   error before `||' token
/home/amin/csc/dhcp-4.2.3/includes/tree.h:217: error: parse
   error before `!' token
In file included from test.cpp:7:
/home/amin/csc/dhcp-4.2.3/includes/dhcpd.h:431: error: no
   body nor ';' separates two class, struct or union declarations
/home/amin/csc/dhcp-4.2.3/includes/dhcpd.h:431: error: parse
   error before `classes'
.

.
.
.
.

.




What would be the problem..
Please let me know.
But I actually need test.cpp and CXX_SRCS := $(wildcard *.cpp) to compile .



Thanks,
Ameen S














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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20120130/ba0a72c4/attachment.html>


More information about the dhcp-users mailing list