From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27071 invoked by alias); 10 Apr 2008 03:18:55 -0000 Received: (qmail 26964 invoked by uid 22791); 10 Apr 2008 03:18:54 -0000 X-Spam-Check-By: sourceware.org Received: from expredir6.cites.uiuc.edu (HELO expredir6.cites.uiuc.edu) (128.174.5.97) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 10 Apr 2008 03:18:33 +0000 Received: from expms3.cites.uiuc.edu (expms3.cites.uiuc.edu [128.174.5.207]) by expredir6.cites.uiuc.edu (8.14.2/8.14.2) with ESMTP id m3A3IIpq025494 for ; Wed, 9 Apr 2008 22:18:24 -0500 (CDT) Received: (from expms3.cites.uiuc.edu [128.174.5.212]) by expms3.cites.uiuc.edu (MOS 3.8.5-GA) with HTTP/1.1 id AYL16917 (AUTH cbouchrd); Wed, 9 Apr 2008 22:18:18 -0500 (CDT) From: Chris Bouchard Subject: Re: linking problem - "undefined reference to ..." To: gcc-help@gcc.gnu.org X-Mailer: Mirapoint Webmail Direct 3.8.5-GA MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20080409221818.AYL16917@expms3.cites.uiuc.edu> Date: Thu, 10 Apr 2008 03:24:00 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2008-04/txt/msg00143.txt.bz2 Brian, >#ifdef __cplusplus >extern "C" { >#endif > >and near the end: > >#ifdef __cplusplus >} >#endif > >The preprocessor symbol __cplusplus is defined when the file is being >compiled as C++, and is used to wrap all the declarations with a large >"extern "C" { ... }". The reason for the #ifdef is that so it remains a >valid C file as well. I wrapped the header file's declarations with "extern "C" { ... }" and it worked! Thank you very much. >That or: > >mv fig6.cpp fig6.c >gcc -o fig6 fig6.c -L. -ltsil I tried this first but got the same error message... Thanks again for all your help. I'm now using the software application! Chris Bouchard