• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Using different compilers for C vs C++?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using different compilers for C vs C++?


  • Subject: Re: Using different compilers for C vs C++?
  • From: "Sean McBride" <email@hidden>
  • Date: Thu, 18 Feb 2010 12:32:08 -0500
  • Organization: Rogue Research Inc.

On 2/13/10 11:26 AM, Jean-Daniel Dupas said:

>> Thanks for this pointer!  I've also just read the "Build Rules" section
>> of the Xcode docs.  Alas, I still can't get this to work.
>>
>> I've opened the target inspector and created a rule (which is at the top
>> of the list)
>> Process: C++ files
>> using:   Rez
>>
>> I expect catastrophic failure.  Everything still builds.  I've tried
>> other choices for 'using' and it seems to have no effect.  I have no
>> other custom rules anywhere (as best as I can tell).
>>
>> Any ideas?
>
>Yes, try with GCC and LLVM-GCC instead of trying with Rez.
>I have redefined C rule tu use GCC-4.2 and add a C++ rule to use llvm-
>gcc and it works (if you want to know if it works, check the transcript )
>Xcode built-in compiler have a list of supported file type, so it will
>probably refuse to use Rez fro c++ and fallback to the default setting.

The test with Rez was a last resort, my initial tests were with C & C++
rules.  So I've just tried this:

- create new project from Cocoa Application stationary
- add a .c file
- add a .cp file
- put the following in both:

#if __GNUC_MINOR__ == 0
	#warning gcc 4.0
#elif __GNUC_MINOR__ == 2
	#warning gcc 4.2
#endif

First I changed between gcc 4.0 and 4.2 by changing GCC_VERSION, this
worked as expected.

Then I:
- went to the target setting > Rules
- I changed the C rule, it said I need to make a duplicate, fine
- it added a new item to the top of the list, fine
- I set "Process" to "C++ source files" and "using" to "GCC 4.0"
- close the window
- clean all
- quit & relaunch Xcode
- build
- examine compiler warnings -> it's still using gcc 4.2

I hope I'm just missing something obvious here....

Cheers,

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


 _______________________________________________
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

  • Follow-Ups:
    • Re: Using different compilers for C vs C++?
      • From: Jean-Daniel Dupas <email@hidden>
References: 
 >Using different compilers for C vs C++? (From: "Sean McBride" <email@hidden>)
 >Re: Using different compilers for C vs C++? (From: Alexander von Below <email@hidden>)
 >Re: Using different compilers for C vs C++? (From: "Sean McBride" <email@hidden>)
 >Re: Using different compilers for C vs C++? (From: Jean-Daniel Dupas <email@hidden>)

  • Prev by Date: Re: Code Signing for Mac application
  • Next by Date: Re: Code Signing for Mac application
  • Previous by thread: Re: Using different compilers for C vs C++?
  • Next by thread: Re: Using different compilers for C vs C++?
  • Index(es):
    • Date
    • Thread