From owner-freebsd-net@FreeBSD.ORG Fri Oct 5 12:04:13 2007 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 312CB16A417 for ; Fri, 5 Oct 2007 12:04:13 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) Received: from pobox.codelabs.ru (pobox.codelabs.ru [144.206.177.45]) by mx1.freebsd.org (Postfix) with ESMTP id CD05B13C49D for ; Fri, 5 Oct 2007 12:04:12 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) DomainKey-Signature: a=rsa-sha1; q=dns; c=simple; s=one; d=codelabs.ru; h=Received:Date:From:To:Cc:Message-ID:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:Sender:X-Spam-Status:Subject; b=oDqmaw6EwAx5MYEfry2Ezc2Dn/oLNwOMk0JBbg72NGjngP+UqdIbFBAfSVdgfveLCmEvIHaqZkFzv5JcTOkcNNq6YoefgQ0XvB1iOIyMIkGgumVIkEQ/zdTxpSNARxqdvUC3ZA/g6zM1kBPRJFqKBmSPBfmZ0hyixrgtTioQWDA=; Received: from void.codelabs.ru (void.codelabs.ru [144.206.177.25]) by pobox.codelabs.ru with esmtpsa (TLSv1:AES256-SHA:256) id 1Idlud-0009jM-Kw; Fri, 05 Oct 2007 16:04:11 +0400 Date: Fri, 5 Oct 2007 16:04:07 +0400 From: Eygene Ryabinkin To: Vinod VM Message-ID: <20071005120406.GQ971@void.codelabs.ru> References: <8de278a20710050424t68cf95eap99cd34a13e8ce594@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <8de278a20710050424t68cf95eap99cd34a13e8ce594@mail.gmail.com> Sender: rea-fbsd@codelabs.ru X-Spam-Status: No, score=-2.2 required=4.0 tests=ALL_TRUSTED,AWL,BAYES_20 Cc: freebsd-net@freebsd.org Subject: Re: cant compile - undefined reference to `bpfattach' X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Oct 2007 12:04:13 -0000 Good day. Fri, Oct 05, 2007 at 04:54:27PM +0530, Vinod VM wrote: > I'm having trouble in compiling my code with gcc on release 6.2 > > I've included the following headers, > > stdlib.h > sys/types.h > sys/socket.h > net/if.h > net/if_var.h > net/if_types.h > net/bpf.h > > When compiling the code, i'm getting the following error message > > /var/tmp//ccphxfRO.o(.text+0x3c): In function `main': > : undefined reference to `bpfattach' If I am correct, bpfattach is the kernel-level function. And you're trying to write some user-space utility, aren't you? If you're trying to capture packets, you'll probably want to consult the pcap(3) manual page. -- Eygene