From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 22 22:22:00 2007 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C052916A413 for ; Sun, 22 Apr 2007 22:22:00 +0000 (UTC) (envelope-from infofarmer@gmail.com) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.224]) by mx1.freebsd.org (Postfix) with ESMTP id 8297A13C468 for ; Sun, 22 Apr 2007 22:22:00 +0000 (UTC) (envelope-from infofarmer@gmail.com) Received: by wr-out-0506.google.com with SMTP id 70so1419671wra for ; Sun, 22 Apr 2007 15:22:00 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition:x-google-sender-auth; b=HfhnxhtiFfc+11G5OMxciQTk1HA0mctDb+Xfe6zQrj7A8eLviVp3Vj8pCTSpV41xSWw9iOz0M2vFz5Ng2vDt9b5BjEfUnAqDfrgIsEXDu/8Detc7Po8OzfSE3wxTN0TM4XNo2KyJaOJ3/Gs7ITIjzl3TDdbpi5+BgDigsh5TzNo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition:x-google-sender-auth; b=K+1ZssoidrEYzM4aJdhGYmjnPFM3lb1I0FyzJzidXVzUAz5xULMDqseFPuSQEU5T5yGzMHDrMjn5s3oC1+MYmCU/GBHraA9MfXMsZkjTOAirPhqQA6sJTMofApwn1k2DKtV+7YwvcIMuXpUL0i+JELXOOmqvi3Bnz2VuLqk819w= Received: by 10.114.147.1 with SMTP id u1mr564365wad.1177278887536; Sun, 22 Apr 2007 14:54:47 -0700 (PDT) Received: by 10.114.194.5 with HTTP; Sun, 22 Apr 2007 14:54:47 -0700 (PDT) Message-ID: Date: Mon, 23 Apr 2007 01:54:47 +0400 From: "Andrew Pantyukhin" Sender: infofarmer@gmail.com To: hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Google-Sender-Auth: ae4852398d36b16c Cc: Subject: extern "C" and undefined reference X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Apr 2007 22:22:00 -0000 7zip developers converted some code from C++ to C, while leaving the main stand-alone lzma app in C++. They use 'extern "C" { }' blocks around #include's referencing C headers. Everything compiles fine, but "undefined reference" errors appear at linkage. The undefined references are to the C functions included from withing those 'extern "C"' wrappers. I tried to remove the wrappers from some files and the amount of errors decreased a bit. Is there a better workaround? Google came up with two results: remove the wrappers or use c++ instead of cc. I'm already using c++. Thanks!