Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [day] [month] [year] [list]
Date: Thu, 11 Oct 2012 10:24:43 -0400
From: "Robert B. Harris" <rs904c@...scape.net>
To: <john-dev@...ts.openwall.com>
Subject: Dynamically linked libpcap for SIPdump compiles for me, but statically linked libpcap for SIPdump does not

John Dev/Dhiru,

 

I'm stumped.  

 

I've been trying to figure out why I can't compile SIPdump with statically
linked libpcap on Linux (I've been trying on the latest build of Owl).  

 

I think vncpcap2john has a similar situation.

 

It probably has nothing to do with SIPdump and vncpcap2john.   

 

How can this be statically linked?

 

gcc -Wall -O2 -I/usr/include -I/usr/local/include /usr/lib64/libpcap.a
SIPdump.c -o ../run/SIPdump

/tmp/.private/rharris/ccIuLDuH.o: In function `main':

SIPdump.c:(.text.startup+0x1e4): undefined reference to `pcap_open_offline'

SIPdump.c:(.text.startup+0x1f8): undefined reference to `pcap_datalink'

SIPdump.c:(.text.startup+0x268): undefined reference to `pcap_freecode'

SIPdump.c:(.text.startup+0x270): undefined reference to `pcap_close'

SIPdump.c:(.text.startup+0x462): undefined reference to `pcap_freecode'

SIPdump.c:(.text.startup+0x4ad): undefined reference to `pcap_compile'

SIPdump.c:(.text.startup+0x4bd): undefined reference to `pcap_setfilter'

SIPdump.c:(.text.startup+0x4e7): undefined reference to `pcap_loop'

SIPdump.c:(.text.startup+0x50e): undefined reference to `pcap_geterr'

SIPdump.c:(.text.startup+0x59d): undefined reference to `pcap_lookupnet'

SIPdump.c:(.text.startup+0x5c5): undefined reference to `pcap_open_live'

SIPdump.c:(.text.startup+0x604): undefined reference to `pcap_geterr'

SIPdump.c:(.text.startup+0x709): undefined reference to `pcap_lookupdev'

collect2: ld returned 1 exit status

 

 

Below works, but is not statically linked:

gcc -s -lpcap SIPdump.c -o ../run/SIPdump

ldd ../run/SIPdump

        libpcap.so.0 => /usr/lib64/libpcap.so.0 (0x00002b233e441000)

        libc.so.6 => /lib64/libc.so.6 (0x00002b233e66c000)

        /lib64/ld-linux-x86-64.so.2 (0x00002b233e22b000)

 


Content of type "text/html" skipped

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.