Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Installing libpcap problem

Installing libpcap problem
Thread Tools
Junior Member
Join Date: Nov 2002
Location: Sweden
Status: Offline
Reply With Quote
May 22, 2005, 03:21 AM
 
Hi, I get this error message when I try to install libcap through fink on 10.4

nametoaddr.c:394: error: conflicting types for `ether_hostton'
/usr/include/net/ethernet.h:113: error: previous declaration of `ether_hostton'
make: *** [nametoaddr.o] Error 1
### execution of make failed, exit code 2
Failed: compiling libpcap-0.8.1-1 failed

any ideas?

Thanks
PowerMac G5 Dual 2.0GHz, 1.5GB RAM & MacBook 1.83, 1.25GB RAM
OS X 10.5.2
www.blurimage.com
     
Mac Elite
Join Date: Oct 2001
Location: Internet
Status: Offline
Reply With Quote
May 31, 2005, 10:26 PM
 
Originally Posted by callefoss
Hi, I get this error message when I try to install libcap through fink on 10.4

nametoaddr.c:394: error: conflicting types for `ether_hostton'
/usr/include/net/ethernet.h:113: error: previous declaration of `ether_hostton'
make: *** [nametoaddr.o] Error 1
### execution of make failed, exit code 2
Failed: compiling libpcap-0.8.1-1 failed

any ideas?

Thanks

Were you trying to install OpenCV or something?

MacBook Air 11" 1.6Ghz 4GB 128GB Backlit Keyboard, 4S, iPad 2
     
Fresh-Faced Recruit
Join Date: Jun 2005
Status: Offline
Reply With Quote
Jun 1, 2005, 01:27 AM
 
Hi there,

You need to modify the libpcap source file (ie. nametoaddr.c) so it matches the /usr/include/net/ethernet.h in Mac OSX.

Basically change /libpcap-0.8.3/nametoaddr.c (in the source file)

from:
extern int ether_hostton(char *, struct ether_addr *);
to:
extern int ether_hostton(const char *, struct ether_addr *);

This will fix the difference between the libpcap source and the Mac OSX definitions. After you have done that it should compile nicely.
     
Junior Member
Join Date: Nov 2002
Location: Sweden
Status: Offline
Reply With Quote
Jun 1, 2005, 02:46 AM
 
Thanks!

Actually what I did which worked (I skipped fink by the way) was to remove the file /usr/include/net/ethernet.h (it is backed up) and then libpcap compiled fine. WHat exactly is that file doing? Do I really need it?
PowerMac G5 Dual 2.0GHz, 1.5GB RAM & MacBook 1.83, 1.25GB RAM
OS X 10.5.2
www.blurimage.com
     
P
Moderator
Join Date: Apr 2000
Location: Gothenburg, Sweden
Status: Offline
Reply With Quote
Jun 1, 2005, 04:27 PM
 
It includes a bunch of constants related to ethernet, like packet structure, how long MAC-addresses are etc. You can read it yourself by opening it in Textedit or whatever. If it isn't included at build time, make probably assumes some defaults. If those are correct, it works.

Restore that file. Once libpcap is compiled, it doesn't care what happens with its include headers - those are only read at compile time - and other apps might need that file to compile correctly.
     
Fresh-Faced Recruit
Join Date: Jun 2005
Status: Offline
Reply With Quote
Jun 7, 2005, 06:32 AM
 
hi I also have some problems to install the libcap on Tiger, but don't have a clue wher the problem comes from, I tried to change the "nametoaddr.c" but the the problem seems to be the same.
here is what I've done (as I'm not a UNIX expert at all):
1. untar the libcap 0.8.1 on my desktop
2. cd path to libcap folder
3. ./configure
4. make--> and I have the following message at the end:

Code:
./nametoaddr.c:398: error: parse error before '*' token ./nametoaddr.c: In function 'ether_hostton': ./nametoaddr.c:400: error: number of arguments doesn't match prototype /usr/include/net/ethernet.h:113: error: prototype declaration ./nametoaddr.c:405: error: 'name' undeclared (first use in this function) ./nametoaddr.c:405: error: (Each undeclared identifier is reported only once ./nametoaddr.c:405: error: for each function it appears in.) ./nametoaddr.c:410: warning: return makes integer from pointer without a cast make: *** [nametoaddr.o] Error 1
5. make install and then I have the following message:

Code:
[ -d /usr/local/lib ] || \ (mkdir -p /usr/local/lib; chmod 755 /usr/local/lib) /usr/bin/install -c -m 644 libpcap.a /usr/local/lib/libpcap.a install: libpcap.a: No such file or directory make: *** [install] Error 71
thanks in advance if you have an idea...
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 07:18 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2