This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: mixing C and C++
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: Eljay Love-Jensen <eljay at adobe dot com>
- Cc: Frank Signorelli <telfsig at yahoo dot com>, gcc-help at gcc dot gnu dot org
- Date: Thu, 02 Oct 2003 17:56:37 +0100
- Subject: Re: mixing C and C++
- Organization: Codesourcery LLC
- References: <5.2.1.1.0.20031002112927.0182cc58@iplan-mn.corp.adobe.com>
Eljay Love-Jensen wrote:
Hi Frank,
The scenario you describe should work just fine, given that you are extern "C"-ing, compiling and linking appropriately.
I have a code base with 17,000 source files, some C, some C++ ... and I haven't had any issues with the mixed C/C++ environment.
You should compile the file containing 'main' and link the program with
g++. On some systems that is not necessary, it may or may not be
on yours.
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
The voices in my head said this was stupid too
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk