[SOLVED] Re: error: Template with C linkage
[SOLVED] Re: error: Template with C linkage
- Subject: [SOLVED] Re: error: Template with C linkage
- From: "Duane Murphy" <email@hidden>
- Date: Fri, 5 May 2006 19:29:53 -0700
--- At Fri, 5 May 2006 19:14:42 -0700, Duane Murphy wrote:
>--- At Fri, 5 May 2006 19:12:42 -0700, Duane Murphy wrote:
>
>>Howdy,
>>I've been working on my project that, for historical reasons, has .c
>>files that need to be compiled as C++. I changed the File Type on all of
>>this files to sourcecode.cpp.cpp.
>>
>>When I have the compiler set to GCC 4.0 and target the 10.4u sdk,
>>everything has been compiling just fine.
>>
>>I need to switch to support using the 10.2.8 SDK. So I switched the SDK
>>and change the Build Rules for the Target to use GCC 3.3. Now I get
>>
>>error: template with C linkage
>>
>>when the .c file (that is set to C++) hits a template.
>>
>>The command line invocation includes c++ and the paths are set to
>>include the gcc/darwin/3.3/c++ paths. The main part of the invocation
>>line (without all the myriad include directories is:
>>
>> /usr/bin/gcc-3.3 -x c++ -arch ppc -pipe -Wno-trigraphs -fpascal-
>>strings -fasm-blocks -g -O0 -Wreturn-type -Woverloaded-virtual -Wunused-
>>function -Wunused-variable -DXML_NS -DPKG_HAS_CWMP -DXML_NS -
>>DPKG_HAS_CWMP -fmessage-length=0 -ffix-and-continue -mtune=G4 -Wno-
>>invalid-offsetof
>>
>>...<more not included>....
>>
>>What do I need to do to get this files to compile?
>
>I should have checked this out a little further. The problem exists with
>regular .cp files as well.
>
>Now I am really scratching my head.
I guess I just needed to believe the error.
The standard C libraries in 3.3 where not C++ friendly. It appears that
one of them leaves an open extern "C" block. I haven't narrowed it down
yet, but I changed some includes from C standard library to C++ standard
library (e.g. stdlib.h to cstdlib) and the files are compiling now.
Thank you and sorry for the distraction,
...Duane
...Duane
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden