Aiee :)

   Hello!

On Tue, Jul 24, 2001 at 06:54:15PM +0000, g. sailesh wrote:
> From: "g. sailesh" <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]

   Please send further email to [EMAIL PROTECTED]
   ([EMAIL PROTECTED] should be an alias for the right address at
   tcpdump.org, tho)

> Hi,
> 
>    I am starter on libpcap stuff, I have a small program
> as below.#include <pcap.h>
> 
> int
> main() {
> 
>     char *dev,*errbuf;
>     dev = pcap_lookupdev( errbuf);

   As stated on the man page, errbuf should be an array (static or
   dynamic one, don't matter - you can't simply use a not-allocated 
   pointer)

>     printf ("%s", dev);
> }
> 
> and when I compile with gcc I get
> 
> /tmp/cc5yAIml.o: In function `main':
> /tmp/cc5yAIml.o(.text+0xd): undefined reference to `pcap_lookupdev'
> collect2: ld returned 1 exit status

   Are you giving the right switch to the compiler (which will be passed
   to the linker) to link against libpcap?

   e.g.

   $ gcc file.c -o file -lpcap             

   (other switch can be used as well)

> Thanks
> sailesh

bye bye

                     -- gg sullivan

-- 
Lorenzo Cavallaro       `Gigi Sullivan' <[EMAIL PROTECTED]>

Until I loved, life had no beauty;
I did not know I lived until I had loved. (Theodor Korner)

-
This is the TCPDUMP workers list. It is archived at
http://www.tcpdump.org/lists/workers/index.html
To unsubscribe use mailto:[EMAIL PROTECTED]?body=unsubscribe

Reply via email to