The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Pcap.h Sniffing papabearcares Shell Programming and Scripting 0 04-16-2008 09:22 PM
Pcap.h Sniffing papabearcares High Level Programming 0 04-16-2008 09:21 PM
Filtering paquets with pcap.h danathane High Level Programming 3 03-03-2008 09:17 AM
pcap.h Pervez Sajjad High Level Programming 8 07-05-2006 12:09 AM
compiling qt nydel UNIX for Dummies Questions & Answers 2 08-03-2001 05:14 PM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-18-2002
TioTony's Avatar
Bit Pusher
 

Join Date: Oct 2001
Location: Southern California
Posts: 332
Compiling Pcap.c

I don't know if this is the correct forum to post this but hopefully someone can atleast point me in the right direction if they can't help me.

I am trying to install the Net::Pcap module for perl from Tim Potter version .04. I have installed gcc 2.95.3 on my Solaris 8 box. I am sure it's just a config/option issue with gcc. When I run:

perl Makefile.PL

I get this:

Note (probably harmless): No library found for -lpcap
Writing Makefile for Net::Pcap

If I manually try to compile Pcap.c using this (I know there are more options I should use but I am not hugely familiar with gcc):

gcc Pcap.c

I get this:

Pcap.xs:18: EXTERN.h: No such file or directory
In file included from Pcap.xs:19:
perl.h:27: config.h: No such file or directory
In file included from Pcap.xs:19:
perl.h:441: embed.h: No such file or directory
In file included from Pcap.xs:19:
perl.h:1664: handy.h: No such file or directory
perl.h:1828: unixish.h: No such file or directory
perl.h:2135: iperlsys.h: No such file or directory
In file included from Pcap.xs:19:
perl.h:2138: sv.h: No such file or directory
perl.h:2139: util.h: No such file or directory
In file included from /usr/include/curses.h:23,
from /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3/include/curses.h:5,
from /usr/include/form.h:13,
from perl.h:2140,
from Pcap.xs:19:
/usr/include/widec.h:38: warning: `getwc' redefined
/usr/include/iso/wchar_iso.h:337: warning: this is the location of the previous definition
/usr/include/widec.h:39: warning: `putwc' redefined
/usr/include/iso/wchar_iso.h:340: warning: this is the location of the previous definition
/usr/include/widec.h:40: warning: `getwchar' redefined
/usr/include/iso/wchar_iso.h:338: warning: this is the location of the previous definition
/usr/include/widec.h:41: warning: `putwchar' redefined
/usr/include/iso/wchar_iso.h:341: warning: this is the location of the previous definition
In file included from Pcap.xs:19:
perl.h:2141: gv.h: No such file or directory
perl.h:2142: cv.h: No such file or directory
perl.h:2143: opnames.h: No such file or directory
perl.h:2144: op.h: No such file or directory
perl.h:2145: cop.h: No such file or directory
perl.h:2146: av.h: No such file or directory
perl.h:2147: hv.h: No such file or directory
perl.h:2148: mg.h: No such file or directory
perl.h:2149: scope.h: No such file or directory
perl.h:2150: warnings.h: No such file or directory
perl.h:2151: utf8.h: No such file or directory
perl.h:2152: sharedsv.h: No such file or directory
perl.h:3058: perly.h: No such file or directory
In file included from Pcap.xs:19:
perl.h:3256: pp.h: No such file or directory
In file included from Pcap.xs:19:
perl.h:3279: opcode.h: No such file or directory
perl.h:3284: embedvar.h: No such file or directory
perl.h:3299: intrpvar.h: No such file or directory
perl.h:3301: thrdvar.h: No such file or directory
perl.h:3314: perlvars.h: No such file or directory
perl.h:4077: patchlevel.h: No such file or directory
In file included from Pcap.xs:20:
XSUB.h:255: perlapi.h: No such file or directory


All the .h files are in my /usr/perl5/5.00503/sun4-solaris/CORE directory.

The README for Pcap mentions they successfully tested on Solaris 2.6 with gcc 2.8.1.

Any help is appreciated.
TioTony
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 01-18-2002
PxT's Avatar
PxT PxT is offline
Registered User
 

Join Date: Oct 2000
Location: Sacramento, CA
Posts: 905
> perl Makefile.PL
> Note (probably harmless): No library found for -lpcap
> Writing Makefile for Net::Pcap

Ok, so far so good. Now just run "make".
Reply With Quote
  #3 (permalink)  
Old 01-18-2002
TioTony's Avatar
Bit Pusher
 

Join Date: Oct 2001
Location: Southern California
Posts: 332
Thanks for the reply.

When I run make I get this:

cc -c -xO3 -xdepend -DVERSION=\"0.04\" -DXS_VERSION=\"0.04\" -KPIC -I/usr/perl5/5.00503/sun4-solaris/CORE Pcap.c
/usr/ucb/cc: language optional software package not installed
*** Error code 1
make: Fatal error: Command failed for target `Pcap.o'


I do not have cc, only gcc. I cannot figure out the options I need to use for gcc to work properly. The readme says they compiled successfully with gcc but don't say how. Any thoughts?
Thanks,
TioTony
Reply With Quote
  #4 (permalink)  
Old 01-21-2002
Registered User
 

Join Date: Nov 2001
Posts: 33
Edit "Makefile". Find The CC=cc and change it to CC=gcc (I hope it exists). I have also the feeling (alsmost certainty) that this pcap.c needs the libpcap library compiled and installed first. Note that you probably will have to make changes to other things in Makefile. I.e. I suppose that the -KPIC directive should change to -DPIC. Try to find if there is a script with name "configure" there (I dont think so...). If it exists execute it.

Greetings
Reply With Quote
  #5 (permalink)  
Old 01-22-2002
TioTony's Avatar
Bit Pusher
 

Join Date: Oct 2001
Location: Southern California
Posts: 332
Thanks for your help thus far. I changed the cc to gcc in the Makefile, which I had done before as well. I think the key was changing KPIC to DPIC. That seems to have gotten me further. There is no config file. When I run make, I now get this:

gcc -c -xO3 -xdepend -DVERSION=\"0.04\" -DXS_VERSION=\"0.04\" -DPIC -I/usr/perl5/5.00503/sun4-solaris/CORE Pcap.c
gcc: language depend not recognized
gcc: Pcap.c: linker input file unused since linking not done
Running Mkbootstrap for Net::Pcap ()
chmod 644 Pcap.bs
LD_RUN_PATH="" gcc -o blib/arch/auto/Net/Pcap/Pcap.so -G Pcap.o
gcc: Pcap.o: No such file or directory
gcc: No input files
*** Error code 1
make: Fatal error: Command failed for target `blib/arch/auto/Net/Pcap/Pcap.so'

All the paths mentioned exit but Pcap.so is not in blib/arch/auto/Net/Pcap/. Where do I go from here? Does anyone know of any good gcc 101 sites that could help me out?
Thanks,
TioTony
Reply With Quote
  #6 (permalink)  
Old 01-22-2002
Registered User
 

Join Date: Nov 2001
Posts: 33
i believe the -x directives are now wrong. The -xO3 i presume it is the optimization. Remove it completeley or try simply -O3. To see the options of gcc simply type #man gcc. If it is not listed, it is not supported. If #man gcc doesnt work try this:

#cd /usr/local/bin/man/man1
#nroff -man gcc.1 |more

Note it is a difficult matter if there is no config file
Reply With Quote
  #7 (permalink)  
Old 01-22-2002
TioTony's Avatar
Bit Pusher
 

Join Date: Oct 2001
Location: Southern California
Posts: 332
Thanks, I guess I'll just keep struggling with it.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 08:48 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0