?
Solved

errors in integrating libpcap and libnet with djgpp c

Posted on 2003-04-01
5
Medium Priority
?
549 Views
Last Modified: 2012-06-21
dear ppl,
i have installed djgpp(almost all options)on win 2k professional. i wanted to do some network programming and hence tried download and make libpcap. i have installed watt32 which i guess is necessary for libpcap on djgpp. i could make watt32 successfully.i have downloaded a djgpp version of libpcap from watt32 page.the problem comes when i try to make libpcap i get the following error:

D:\REALJA~1\ATLIVO~1\libpcap>make -f makefile.dj
d:/djgpp/bin/make.exe -f Makefile.dj -C ./pm_drvr/ core_obj drvr_obj
make.exe[1]: Entering directory `d:/realjassi/atlivorecarnivore/libpcap/PM_DRVR'
gcc.exe -c -g -O2 -I. -IWATT_ROOT=d:/net/watt/inc -Wall -Winline -mcpu=i486 -DUSE_32BIT_DR
IVERS -DDEBUG -DEL_DEBUG=6 -DNET_DEBUG=6 -DVORTEX_DEBUG=6 -DETH16I_DEBUG=6 -DETHPK_DEBUG=6
 -DAPRICOT_DEBUG=6 -DAT17_DEBUG=6 -DDE4X5_DEBUG=6 -DDE600_DEBUG=6 -DDE620_DEBUG=6 -DDEFXX_
DEBUG=6 -DEWRK3_DEBUG=6 -DSMC_DEBUG=6 -DPCMCIA_DEBUG=2 -DTC90XBC_DEBUG=1 -DSUPPORT_NE_BAD_
CLONES -DNE_SANITY_CHECK -DNE8390_RW_BUGFIX -DCONFIG_PCI -DCONFIG_PCI_OPTIMIZE -DCONFIG_PC
I_QUIRKS printk.c
WATT_ROOT=d:/net/watt/inc: Bad address (EFAULT)
make.exe[1]: *** [printk.o] Error 1
make.exe[1]: Leaving directory `d:/realjassi/atlivorecarnivore/libpcap/PM_DRVR'
make.exe: *** [pm_objects] Error 2

SIMILARLY WHEN I TRY TO MAKE LIBNET I GET THE FOLLOWING ERROR AND AM NOT ABLE TO GET THE LIBNET.A OR LIBNET.LIB LIBRARY AND HENCE AM UNABLE TO DO A MAKE INSTALL. THE FOLLOWING  IS THE ERROR BEFORE AND AFTER I INSTALLED WATT32. ALSO THERE IS A LOT MORE BEFORE THESE ERRORS SHOWN BELOW IF U NEED THEM PLEASE TELL ME.
BEFORE INSTALLING WATT32
cc1.exe: warnings being treated as errors
drivers/serdos.c: In function `isr':
drivers/serdos.c:178: warning: deprecated use of label at end of compound statem
ent
make.exe[1]: *** [drivers/serdos.o] Error 1
make.exe[1]: Leaving directory `d:/realjassi/atlivorecarnivore/libnet/libnet/lib
'
make.exe: *** [lib] Error 2

AFTER INSTALLING WATT32
cc1.exe: warnings being treated as errors
In file included from drivers/wsockdos.c:27:
include/wsockdos.h:59: warning: redefinition of `u_char'
d:/net/watt/inc/sys/wtypes.h:87: warning: `u_char' previously declared here
include/wsockdos.h:60: warning: redefinition of `u_short'
d:/net/watt/inc/sys/wtypes.h:88: warning: `u_short' previously declared here
include/wsockdos.h:61: warning: redefinition of `u_int'
d:/net/watt/inc/sys/wtypes.h:84: warning: `u_int' previously declared here
include/wsockdos.h:62: warning: redefinition of `u_long'
d:/net/watt/inc/sys/wtypes.h:90: warning: `u_long' previously declared here
In file included from drivers/wsockdos.c:27:
include/wsockdos.h:157:1: "IPPROTO_GGP" redefined
In file included from drivers/wsockdos.c:25:
d:/net/watt/inc/netinet/in.h:67:1: this is the location of the previous definition
include/wsockdos.h:171: redefinition of `struct in_addr'
In file included from drivers/wsockdos.c:27:
include/wsockdos.h:194:1: "INADDR_LOOPBACK" redefined
In file included from drivers/wsockdos.c:25:
d:/net/watt/inc/netinet/in.h:187:1: this is the location of the previous definition
In file included from drivers/wsockdos.c:27:
include/wsockdos.h:195:1: "INADDR_BROADCAST" redefined
In file included from drivers/wsockdos.c:25:
d:/net/watt/inc/netinet/in.h:186:1: this is the location of the previous definition
In file included from drivers/wsockdos.c:27:
include/wsockdos.h:196:1: "INADDR_NONE" redefined
In file included from drivers/wsockdos.c:25:
d:/net/watt/inc/netinet/in.h:188:1: this is the location of the previous definition
include/wsockdos.h:201: redefinition of `struct sockaddr_in'
make.exe[1]: *** [drivers/wsockdos.o] Error 1
make.exe[1]: Leaving directory `d:/realjassi/atlivorecarnivore/libnet/libnet/lib'
make.exe: *** [lib] Error 2
0
Comment
Question by:sachdevajatin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 5

Accepted Solution

by:
Kocil earned 756 total points
ID: 8246020
----
D:\REALJA~1\ATLIVO~1\libpcap>make -f makefile.dj
----
I suggest you to use the directory that uses less than 8 characters without white space.


For libcap, See this error message.
---
WATT_ROOT=d:/net/watt/inc: Bad address (EFAULT)
---
Either you have to install the watt there,
or edit the makefile.dj accordingly.

For libnet, the message is
----
drivers/serdos.c:178: warning: deprecated use of label at end of compound statem
ent
----

I guess somebody was playing unstructured programming with goto-label here. Your options:
* Patch the source by replacing the label-goto with structured algorithms (for, while, do-while, etc)
* Just ignore the warning, but I dont know which options to turn it off.


----
AFTER INSTALLING WATT32
cc1.exe: warnings being treated as errors
In file included from drivers/wsockdos.c:27:
include/wsockdos.h:59: warning: redefinition of `u_char'
d:/net/watt/inc/sys/wtypes.h:87: warning: `u_char' previously declared here
...
----
There were double declaration. You have to carefully examine the #include files, there might be overlaped declaration.
You may help this situation by editing wsockdos to add something like
#ifndef u_char
#define u_char ...
#endif.





0
 

Author Comment

by:sachdevajatin
ID: 8260851
Dear all,
let me put it again for u. i have a fresh installation of djgpp in d:\djgpp. i have created the env. variable for djgpp.env and in Path i have given d:\djgpp\bin. everything is working fine. now i download libnet(libnet-0.10.11) and unzip it to d:\djgpp\libnet with the directory structure retained. i go into the d:\djgpp\libnet\makfiles directory and copy djgpp.mak to d:\djgpp\libnet as port.mak. now i type make here in the
d:\djgpp\libnet folder at the cmd prompt and i get the following errors. a snapshot follows. if anyone has done this before please tell me the steps to be successful in compliling libnet. this is standard readme procedure that i follow. where did i go wrong and why would i have to do something different than what the readme says.


sing-declarations -g -I../include -Iinclude -DTARGET_DJGPP   -c -o core/threads.
o core/threads.c
gcc -O2 -Wall -Werror -Wno-unused -Wstrict-prototypes -Wmissing-prototypes -Wmis
sing-declarations -g -I../include -Iinclude -DTARGET_DJGPP   -c -o core/wait.o c
ore/wait.c
gcc -O2 -Wall -Werror -Wno-unused -Wstrict-prototypes -Wmissing-prototypes -Wmis
sing-declarations -g -I../include -Iinclude -DTARGET_DJGPP   -c -o core/address.
o core/address.c
gcc -O2 -Wall -Werror -Wno-unused -Wstrict-prototypes -Wmissing-prototypes -Wmis
sing-declarations -g -I../include -Iinclude -DTARGET_DJGPP   -c -o drivers/nonet
.o drivers/nonet.c
gcc -O2 -Wall -Werror -Wno-unused -Wstrict-prototypes -Wmissing-prototypes -Wmis
sing-declarations -g -I../include -Iinclude -DTARGET_DJGPP   -c -o drivers/wsock
dos.o drivers/wsockdos.c
gcc -O2 -Wall -Werror -Wno-unused -Wstrict-prototypes -Wmissing-prototypes -Wmis
sing-declarations -g -I../include -Iinclude -DTARGET_DJGPP   -c -o drivers/inter
net.o drivers/internet.c
gcc -O2 -Wall -Werror -Wno-unused -Wstrict-prototypes -Wmissing-prototypes -Wmis
sing-declarations -g -I../include -Iinclude -DTARGET_DJGPP   -c -o drivers/templ
ate.o drivers/template.c
gcc -O2 -Wall -Werror -Wno-unused -Wstrict-prototypes -Wmissing-prototypes -Wmis
sing-declarations -g -I../include -Iinclude -DTARGET_DJGPP   -c -o drivers/ipx.o
 drivers/ipx.c
gcc -O2 -Wall -Werror -Wno-unused -Wstrict-prototypes -Wmissing-prototypes -Wmis
sing-declarations -g -I../include -Iinclude -DTARGET_DJGPP   -c -o drivers/ipxso
cks.o drivers/ipxsocks.c
gcc -O2 -Wall -Werror -Wno-unused -Wstrict-prototypes -Wmissing-prototypes -Wmis
sing-declarations -g -I../include -Iinclude -DTARGET_DJGPP   -c -o drivers/seria
l.o drivers/serial.c
gcc -O2 -Wall -Werror -Wno-unused -Wstrict-prototypes -Wmissing-prototypes -Wmis
sing-declarations -g -I../include -Iinclude -DTARGET_DJGPP   -c -o drivers/serdo
s.o drivers/serdos.c
cc1.exe: warnings being treated as errors
drivers/serdos.c: In function `isr':
drivers/serdos.c:178: warning: deprecated use of label at end of compound statem
ent
make.exe[1]: *** [drivers/serdos.o] Error 1
make.exe[1]: Leaving directory `d:/djgpp/libnet/lib'
make.exe: *** [lib] Error 2
0
 

Author Comment

by:sachdevajatin
ID: 8272420
ok i agree watt_root was a mistake. i realized after remaking watt32. after doing it all over again i get the following errors while making libpcap

D:\net\libpcap>make -f makefile.dj
d:/djgpp/bin/make.exe -f Makefile.dj -C ./pm_drvr/ core_obj drvr_obj
make.exe[1]: Entering directory `d:/net/libpcap/PM_DRVR'
make.exe[1]: *** No rule to make target `intwrap.o', needed by `core_obj'.
Stop
.
make.exe[1]: Leaving directory `d:/net/libpcap/PM_DRVR'
make.exe: *** [pm_objects] Error 2

is there some way i can test libnet if it is done ok. and similarly for libpcap once its done.
also could someone tell me where i can get real mode packet driver for my D-Link DFE-538TX 10/100 Adapter. i guess without that stuff wont work. or is there a work around?

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question