- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: ld: cannot find -lpcap
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-04-2004 02:06 AM
тАО05-04-2004 02:06 AM
http://dns.measurement-factory.com/tools/dnstop/
Had to modify Makefile to:
CFLAGS=-g -Wall -I/usr/local/include -I/usr/local/lib
PROG=dnstop
DATE!=date +%Y%m%d
CC=gcc
SRCS= $(PROG).c \
known_tlds.h
# You may need to uncomment this, esp on Solaris
XTRALIBS= #-lnsl -lresolv -lsocket
all: $(PROG)
$(PROG): $(PROG).o
$(CC) $(CFLAGS) -o $@ $(PROG).o -lpcap -lcurses $(XTRALIBS)
clean:
rm -f $(PROG) $(PROG).o $(PROG).core $(PROG).c~
tar:
mkdir $(PROG)-$(DATE)
cp -p LICENSE CHANGES $(SRCS) dnstop.8 Makefile $(PROG)-$(DATE)
tar czvf $(PROG)-$(DATE).tar.gz $(PROG)-$(DATE)
chmod 444 $(PROG)-$(DATE).tar.gz
rm -rf $(PROG)-$(DATE)
sha1:root:/usr/local/src/dnstop-20040309 # cat Makefile
CFLAGS=-g -Wall -I/usr/local/include -I/usr/local/lib
PROG=dnstop
DATE!=date +%Y%m%d
CC=gcc
SRCS= $(PROG).c \
known_tlds.h
# You may need to uncomment this, esp on Solaris
XTRALIBS= #-lnsl -lresolv -lsocket
all: $(PROG)
$(PROG): $(PROG).o
$(CC) $(CFLAGS) -o $@ $(PROG).o -lpcap -lcurses $(XTRALIBS)
clean:
rm -f $(PROG) $(PROG).o $(PROG).core $(PROG).c~
tar:
mkdir $(PROG)-$(DATE)
cp -p LICENSE CHANGES $(SRCS) dnstop.8 Makefile $(PROG)-$(DATE)
tar czvf $(PROG)-$(DATE).tar.gz $(PROG)-$(DATE)
chmod 444 $(PROG)-$(DATE).tar.gz
rm -rf $(PROG)-$(DATE)
Using gcc version 3.3.2
I installed these first:
libpcap-0.8.1-sd-11.00.depot
tcpdump-3.8.1-sd-11.00.depot
bison-1.875-sd-11.00.depot
flex-2.5.4a-sd-11.00.depot
I try make all from
/usr/local/src/dnstop-20040309
gcc -g -Wall -I/usr/local/include -I/usr/local/lib -o dnstop dnstop.o -lpcap -lcurses
/opt/pa20_64/bin/../lib/gcc-lib/hppa64-hp-hpux11.11/3.3.2/../../../../hppa64-hp-hpux11.11/bin/ld: cannot find -lpcap
collect2: ld returned 1 exit status
*** Error exit code 1
Stop.
I'm compiling as root on HP-UX 11.11.
Thanks...Geoff
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-04-2004 02:13 AM
тАО05-04-2004 02:13 AM
Re: ld: cannot find -lpcap
http://hpux.connect.org.uk/hppd/hpux/Networking/Admin/libpcap-0.8.1/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-04-2004 02:23 AM
тАО05-04-2004 02:23 AM
Re: ld: cannot find -lpcap
I had to add -I/usr/local/include -I/usr/local/lib to the CFLAGS for it to see pcap.h and pcap-bpf.h
libpcap.a and libpcap.sl are in /usr/local/lib/
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-04-2004 02:27 AM
тАО05-04-2004 02:27 AM
Re: ld: cannot find -lpcap
# export LPATH=/usr/local/lib:/usr/lib
# make all
gcc -g -Wall -I/usr/local/include -I/usr/local/lib -o dnstop dnstop.o -lpcap -lcurses
/usr/lib/crt0.o: file not recognized: File format not recognized
collect2: ld returned 1 exit status
*** Error exit code 1
Stop.
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-04-2004 02:46 AM
тАО05-04-2004 02:46 AM
Re: ld: cannot find -lpcap
Hmm, I guess you do.
Make your life easier and rename is to gcc64
64bit objects do NOT mix with 32bit objects
all objects (including crt0.o) in /usr/lib are 32 bit
64bit objects are in /usr/lib/pa20_64
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-04-2004 03:09 AM
тАО05-04-2004 03:09 AM
Re: ld: cannot find -lpcap
# which gcc
/opt/pa20_64/bin/gcc
So I tried:
export LPATH=/usr/local/lib
Now I get:
# make all
gcc -g -Wall -I/usr/local/include -I/usr/local/lib -o dnstop dnstop.o -lpcap -lcurses
/usr/local/lib/libpcap.sl: file not recognized: File format not recognized
collect2: ld returned 1 exit status
*** Error exit code 1
Stop.
# file /usr/local/lib/libpcap.sl
/usr/local/lib/libpcap.sl: PA-RISC1.1 shared library
# what /usr/local/lib/libpcap.sl
/usr/local/lib/libpcap.sl:
$Header: /tcpdump/master/libpcap/fad-gifc.c,v 1.4.2.1 2003/11/15 23:26:39 guy Exp $ (LBL)
$Header: /tcpdump/master/libpcap/inet.c,v 1.58.2.1 2003/11/15 23:26:41 guy Exp $ (LBL)
$Header: /tcpdump/master/libpcap/gencode.c,v 1.193.2.2 2003/12/18 20:37:12 guy Exp $ (LBL)
$Header: /tcpdump/master/libpcap/optimize.c,v 1.76.2.3 2003/12/22 00:26:36 guy Exp $ (LBL)
$Header: /tcpdump/master/libpcap/etherent.c,v 1.21.6.1 2003/11/15 23:26:38 guy Exp $ (LBL)
$Header: /tcpdump/master/libpcap/bpf/net/bpf_filter.c,v 1.43.2.1 2003/11/15 23:26:49 guy Exp $ (LBL)
$Header: /tcpdump/master/libpcap/bpf_image.c,v 1.25.2.1 2003/11/15 23:26:38 guy Exp $ (LBL)
$Header: /tcpdump/master/libpcap/bpf_dump.c,v 1.13.2.1 2003/11/15 23:26:37 guy Exp $ (LBL)
$Header: /tcpdump/master/libpcap/pcap-dlpi.c,v 1.91.2.3 2003/11/21 10:20:46 guy Exp $ (LBL)
$Header: /tcpdump/master/libpcap/pcap.c,v 1.63.2.6 2003/11/21 10:20:49 guy Exp $ (LBL)
$Header: /tcpdump/master/libpcap/nametoaddr.c,v 1.68.2.3 2003/11/19 18:13:48 guy Exp $ (LBL)
$Header: /tcpdump/master/libpcap/savefile.c,v 1.92.2.8 2003/12/21 21:52:36 guy Exp $ (LBL)
$Header: /tcpdump/master/libpcap/scanner.l,v 1.95.2.2 2003/12/16 05:20:44 guy Exp $ (LBL)
$Header: /tcpdump/master/libpcap/grammar.y,v 1.79.2.2 2003/12/16 05:20:44 guy Exp $ (LBL)
I also have
# /opt/gcc/bin/gcc -v
Reading specs from /opt/gcc/lib/gcc-lib/hppa2.0n-hp-hpux11.00/2.95.3/specs
gcc version 2.95.3 20010315 (release)
So I'm going to try that version...
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-04-2004 03:27 AM
тАО05-04-2004 03:27 AM
Re: ld: cannot find -lpcap
# make clean
rm -f dnstop dnstop.o dnstop.core dnstop.c~
# export LPATH=/usr/local/lib
# make all
gcc -g -Wall -I/usr/local/include -I/usr/local/lib -c dnstop.c
dnstop.c: In function `StringCounter_report':
dnstop.c:751: warning: implicit declaration of function `getmaxy'
gcc -g -Wall -I/usr/local/include -I/usr/local/lib -o dnstop dnstop.o -lpcap -lcurses
/usr/local/lib/libpcap.sl: file not recognized: File format not recognized
collect2: ld returned 1 exit status
*** Error exit code 1
Stop.
With gcc 2.95:
# make clean
rm -f dnstop dnstop.o dnstop.core dnstop.c~
# make all
/opt/gcc/bin/gcc -g -Wall -I/usr/local/include -I/usr/local/lib -c dnstop.c
In file included from /usr/local/include/pcap.h:51,
from dnstop.c:16:
/opt/gcc/lib/gcc-lib/hppa2.0n-hp-hpux11.00/2.95.3/include/stdio.h:30: warning: `__va__list' redefined
/usr/include/sys/stdsyms.h:422: warning: this is the location of the previous definition
In file included from dnstop.c:19:
/opt/gcc/lib/gcc-lib/hppa2.0n-hp-hpux11.00/2.95.3/include/stdlib.h:28: warning: `__va__list' redefined
/opt/gcc/lib/gcc-lib/hppa2.0n-hp-hpux11.00/2.95.3/include/stdio.h:30: warning: this is the location of the previous definition
In file included from dnstop.c:27:
/opt/gcc/lib/gcc-lib/hppa2.0n-hp-hpux11.00/2.95.3/include/arpa/nameser.h:94: warning: `/*' within comment
In file included from dnstop.c:29:
/usr/include/sys/socket.h:484: parse error before `sendfile'
/usr/include/sys/socket.h:484: parse error before `bsize_t'
/usr/include/sys/socket.h:485: warning: data definition has no type or storage class
/usr/include/sys/socket.h:486: parse error before `sendpath'
/usr/include/sys/socket.h:486: parse error before `bsize_t'
/usr/include/sys/socket.h:487: warning: data definition has no type or storage class
In file included from /usr/include/sys/mp.h:55,
from /usr/include/sys/malloc.h:59,
from /usr/include/net/netmp.h:53,
from /usr/include/net/if.h:59,
from dnstop.c:31:
/usr/include/machine/sys/setjmp.h:45: redefinition of `struct label_t'
/usr/include/machine/sys/setjmp.h:59: warning: redefinition of `label_t'
/opt/gcc/lib/gcc-lib/hppa2.0n-hp-hpux11.00/2.95.3/include/sys/types.h:369: warning: `label_t' previously declared here
dnstop.c: In function `StringCounter_report':
dnstop.c:751: warning: implicit declaration of function `getmaxy'
*** Error exit code 1
Stop.
Sigh.......
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-04-2004 06:47 AM
тАО05-04-2004 06:47 AM
Re: ld: cannot find -lpcap
http://hpux.ee.ualberta.ca/hppd/hpux/Gnu/gcc-3.3.2/
The Makefile is default except for CC=/usr/local/bin/gcc
# make clean
rm -f dnstop dnstop.o dnstop.core dnstop.c~
# make all
/usr/local/bin/gcc -g -Wall -c dnstop.c
In file included from dnstop.c:29:
/usr/include/sys/socket.h:484: parse error before "sendfile"
/usr/include/sys/socket.h:485: parse error before "bsize_t"
/usr/include/sys/socket.h:486: parse error before "sendpath"
/usr/include/sys/socket.h:487: parse error before "bsize_t"
In file included from /usr/include/sys/mp.h:55,
from /usr/include/sys/malloc.h:59,
from /usr/include/net/netmp.h:53,
from /usr/include/net/if.h:59,
from dnstop.c:31:
/usr/include/machine/sys/setjmp.h:45: redefinition of `struct label_t'
dnstop.c: In function `StringCounter_report':
dnstop.c:751: warning: implicit declaration of function `getmaxy'
*** Error exit code 1
Stop.
Any ideas?
Thanks...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-04-2004 07:08 AM
тАО05-04-2004 07:08 AM
Re: ld: cannot find -lpcap
# make all
/usr/local/bin/gcc -g -Wall -c dnstop.c
In file included from dnstop.c:29:
/usr/include/sys/socket.h:484: parse error before "sendfile"
/usr/include/sys/socket.h:485: parse error before "bsize_t"
/usr/include/sys/socket.h:486: parse error before "sendpath"
/usr/include/sys/socket.h:487: parse error before "bsize_t"
dnstop.c: In function `StringCounter_report':
dnstop.c:751: warning: implicit declaration of function `getmaxy'
*** Error exit code 1
Stop.
Here's the function:
StringCounter_report(StringCounter * list, char *what)
{
StringCounter *sc;
int nlines = getmaxy(w) - 6;
printw("%-20s %9s %6s\n", what, "count", "%");
printw("%-20s %9s %6s\n",
"--------------------", "---------", "------");
for (sc = list; sc; sc = sc->next) {
printw("%-20.20s %9d %6.1f\n",
sc->s,
sc->count,
100.0 * sc->count / query_count_total);
if (0 == --nlines)
break;
}
}
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-04-2004 07:15 AM
тАО05-04-2004 07:15 AM
Re: ld: cannot find -lpcap
#include
to your source file or include it in a header file before socket.h. NOTE: some typedefs are controlled by #ifdef's so that you may need to assert some defines in your makefile.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-04-2004 07:31 AM
тАО05-04-2004 07:31 AM
Re: ld: cannot find -lpcap
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-04-2004 07:48 AM
тАО05-04-2004 07:48 AM
Re: ld: cannot find -lpcap
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-05-2004 01:52 AM
тАО05-05-2004 01:52 AM
Re: ld: cannot find -lpcap
Thanks...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-05-2004 02:09 AM
тАО05-05-2004 02:09 AM
Re: ld: cannot find -lpcap
where do you want to have it?
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-05-2004 02:12 AM
тАО05-05-2004 02:12 AM
Re: ld: cannot find -lpcap
Did you use gcc or HP?
How about on your site?
http://www.cmve.net/~merijn/
Thanks...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-05-2004 02:20 AM
тАО05-05-2004 02:20 AM
Solution--8<-- Makefile
CFLAGS=-g -Wall -I/usr/local/include -I/pro/local/include
PROG=dnstop
DATE != date +%Y%m%d
CC=gcc
SRCS= $(PROG).c \
known_tlds.h
# You may need to uncomment this, esp on Solaris
XTRALIBS= # -lnsl -lresolv -lsocket
all: $(PROG)
$(PROG): $(PROG).o
$(CC) $(CFLAGS) -o $@ $(PROG).o -static -L/usr/local/lib -L/pro/local/lib -lpcap -lncurses $(XTRALIBS)
clean:
rm -f $(PROG) $(PROG).o $(PROG).core $(PROG).c~
tar:
mkdir $(PROG)-$(DATE)
cp -p LICENSE CHANGES $(SRCS) dnstop.8 Makefile $(PROG)-$(DATE)
tar czvf $(PROG)-$(DATE).tar.gz $(PROG)-$(DATE)
chmod 444 $(PROG)-$(DATE).tar.gz
rm -rf $(PROG)-$(DATE)
-->8---
I added two include directories to CFLAGS (-I...)
I added to lib search path's to ld (-L...)
I added -statc to load, so I don't have to supply libpcap.sl and libncurses.sl
I changed #include
http://www.cmve.net/~merijn/dnstop-20040309-pa2.0
Enjoy. Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-05-2004 02:21 AM
тАО05-05-2004 02:21 AM
Re: ld: cannot find -lpcap
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-05-2004 03:22 AM
тАО05-05-2004 03:22 AM
Re: ld: cannot find -lpcap
I'd still like to compile myself - almost got it working...did the same as you....had to add:
#ifndef _BSIZE32_T
# define _BSIZE32_T
typedef int32_t sbsize32_t;
typedef uint32_t bsize32_t;
#endif
#ifndef _BSIZE64_T
# define _BSIZE64_T
# if !defined(__STDC_32_MODE__)
typedef int64_t sbsize64_t;
typedef uint64_t bsize64_t;
# endif
#endif
#ifndef _BSIZE_T
# define _BSIZE_T
# if defined(_APP32_64BIT_OFF_T) || defined(_KERNEL)
typedef int64_t sbsize_t;
typedef uint64_t bsize_t;
# else
typedef long sbsize_t;
typedef unsigned long bsize_t;
# endif
#endif
To bottom of /usr/local/lib/gcc-lib/hppa2.0n-hp-hpux11.00/3.2/include/sys/types.h before the last #endif
Now I get:
# gmake all
/usr/local/bin/gcc -g -Wall -I/usr/local/include -c -o dnstop.o dnstop.c
cc1: warning: changing search order for system directory "/usr/local/include"
cc1: warning: as it has already been specified as a non-system directory
/usr/local/bin/gcc -g -Wall -I/usr/local/include -o dnstop dnstop.o -static -L/usr/local/lib -lpcap -lncurses
/usr/ccs/bin/ld: Unsatisfied symbols:
shl_load (first referenced in /usr/lib/libc.a(nss_deffinder.o)) (code)
shl_findsym (first referenced in /usr/lib/libc.a(nss_deffinder.o)) (code)
collect2: ld returned 1 exit status
gmake: *** [dnstop] Error 1
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-05-2004 03:29 AM
тАО05-05-2004 03:29 AM
Re: ld: cannot find -lpcap
these symbols are in /usr/lib/dld.sl, libdld.sl, and libc_r.sl (the reentrant version of libc)
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-05-2004 03:37 AM
тАО05-05-2004 03:37 AM
Re: ld: cannot find -lpcap
Had to do it like this:
CFLAGS=-g -Wall -l:libdld.sl -I/usr/local/include
Otherwise I got
/usr/bin/ld: Can't find library: "dld"
Thanks for all your help.
Rgds...Geoff