From owner-freebsd-bugs Thu Jul 9 15:40:28 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA07985 for freebsd-bugs-outgoing; Thu, 9 Jul 1998 15:40:28 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id PAA07964 for ; Thu, 9 Jul 1998 15:40:18 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id PAA08901; Thu, 9 Jul 1998 15:40:04 -0700 (PDT) Received: (from nobody@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA06998; Thu, 9 Jul 1998 15:31:46 -0700 (PDT) (envelope-from nobody) Message-Id: <199807092231.PAA06998@hub.freebsd.org> Date: Thu, 9 Jul 1998 15:31:46 -0700 (PDT) From: cts@internetcds.com To: freebsd-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: www-1.0 Subject: misc/7229: /usr/include/pcap*.h isn't C++ safe. Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 7229 >Category: misc >Synopsis: /usr/include/pcap*.h isn't C++ safe. >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Jul 9 15:40:01 PDT 1998 >Last-Modified: >Originator: Craig Spannring >Organization: InternetCDS >Release: 2.2.6 and 3.0 >Environment: FreeBSD backmaster.cdsnet.net 3.0-CURRENT FreeBSD 3.0-CURRENT #2: Tue May 5 20:30:34 PDT 1998 root@backmaster.cdsnet.net:/n/FreeBSD/3.0-back2/src/sys/compile/BACK2 i386 >Description: None of the header files for the packet capture library are suitable to include in a C++ file. They are missing the #ifdef __cplusplus extern "C" { #endif to give the declared functions C linkage >How-To-Repeat: Trying to compile this- #include #include main(int argc, char **argv) { pcap_t *cap = NULL; char errorBuf[4096]; cap = pcap_open_offline(argv[1], errorBuf); if (cap == NULL) { cout << "Error- " << errorBuf << endl; exit(1); } } as a C++ program will give this error- c++ tcpdump.cxx /var/tmp/ccR273601.o: Undefined symbol `_pcap_open_offline__FPcT0' referenced from text segment >Fix: Add the #ifdef __cplusplus extern "C" { #endif incantation to the begining of each of the pcap*.h files. >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message