This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: C linkage when using C++
- From: Joe Buck <jbuck at synopsys dot COM>
- To: Maureen dot Altenau at mail1 dot monmouth dot army dot mil (Altenau, Maureen D CECOM RDEC C2D)
- Cc: gcc at gcc dot gnu dot org ('gcc at gcc dot gnu dot org')
- Date: Mon, 3 Dec 2001 12:05:31 -0800 (PST)
- Subject: Re: C linkage when using C++
> I have downloaded gcc 3.0.2 from the Sun Freeware site. I unzipped it and
> then used pkgadd to install it on a Sparc 2.5.1 system. It seems that the
> installation went well. I am trying to compile code that has templates and
> global functions that override the operator+ function. With respect to the
> templates error, I get "Templates with C Linkage" and with respect to the
> operator+ functions I get an error that states that they "Conflict" with
> each other. I do not have any extern "C" statements in my code. Should I
> be setting a compiler switch that tells g++ that it is compiling C++? Are
> there compiler directives that need to be defined? Has anyone had a problem
> with this. Any help would be greatly appreciated.
It's hard to make much sense of this without seeing code, or at least the
actual error messages rather than a paraphrase. If you could
send a complete program that shows this failure it will be much easier to
track down the problem.