This widget could not be displayed.
Operating System - HP-UX
1845516 Members
2247 Online
110244 Solutions
This widget could not be displayed.
This widget could not be displayed.
This widget could not be displayed.
This widget could not be displayed.
This widget could not be displayed.
This widget could not be displayed.
This widget could not be displayed.
New Discussion
This widget could not be displayed.
This widget could not be displayed.

Re: libpcap-1.1.1 Compilation

 

libpcap-1.1.1 Compilation

Hi;

I want to compile libpcap and I did following steps

1. ./configure --without-flex --without-bison
2. make

When I run make command I am getting following error messages
===============================================
./runlex.sh flex -oscanner.c scanner.l
yacc -d grammar.y
mv y.tab.c grammar.c
mv y.tab.h tokdefs.h
gcc -O2 -fpic -I. -DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -c scanner.c
In file included from scanner.l:70:
tokdefs.h:109: warning: data definition has no type or storage class
tokdefs.h:110: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'yylval'
scanner.l:90: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'pcap_lval'
scanner.l: In function 'yylex':
scanner.l:335: error: 'pcap_lval' undeclared (first use in this function)
scanner.l:335: error: (Each undeclared identifier is reported only once
scanner.l:335: error: for each function it appears in.)
*** Error exit code 1
===============================================

I downloaded libpcap from http://www.tcpdump.org/.

I installed flex in my machine and changed configure and runlex.sh scripts according to it.

Can anybody suggest me what I need to do to remove above errors.
I installed flex and

6 REPLIES 6
Dennis Handly
Acclaimed Contributor

Re: libpcap-1.1.1 Compilation

tokdefs.h:109: warning: data definition has no type or storage class
tokdefs.h:110: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'yylval'
scanner.l:90: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'pcap_lval'

What's on (or before) these lines?
Perhaps your yacc grammar is bad?

Re: libpcap-1.1.1 Compilation

tokdefs.h:110 and scanner.l:90 are reffering to the below declaration

extern YYSTYPE yylval;
Dennis Handly
Acclaimed Contributor

Re: libpcap-1.1.1 Compilation

>extern YYSTYPE yylval;

And is YYSTYPE already defined and what is it?
Jose Mosquera
Honored Contributor

Re: libpcap-1.1.1 Compilation

Hi,

You have available a binary depot ready to install in HP-UX:
http://hpux.connect.org.uk/hppd/hpux/Networking/Admin/libpcap-1.1.1/

Keep attention about package dependencies (bison, flex) also available in the site. Very important that you read the instalation doc:
http://hpux.connect.org.uk/hppd/cgi-bin/wwwtar?/hpux/Networking/Admin/libpcap-1.1.1/libpcap-1.1.1-src-11.11.tar.gz+libpcap-1.1.1/HPUX.Install+text

Rgds.

Re: libpcap-1.1.1 Compilation

Thanks I got the binary

Re: libpcap-1.1.1 Compilation

Thanks