• 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
typedef problem in Xcode 2.2
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

typedef problem in Xcode 2.2


  • Subject: typedef problem in Xcode 2.2
  • From: "Ando Sonenblick" <email@hidden>
  • Date: Tue, 21 Mar 2006 09:35:39 -0800
  • Thread-topic: typedef problem in Xcode 2.2

Gang,

 

I’m porting old code from Codewarrior to Xcode 2.2 (not using the project importer, just building a new xcode project from scratch) and I have a problem with typedefs.   This is all C++ code and I have set Xcode to always use the C++ compiler.

 

In a .h file I have a typedef:

 

     typedef unsigned char *PascalStringPtr;

 

I have another .h file that includes the above .h file and then in a class declaration uses the new type PascalStringPtr:

 

   Class String

   {

      PascalStringPtr       fString;

   …

   };

 

Xcode complains that PascalStringPtr “does not name a type”.

 

After some futzing around I found out that:

 

  1. Xcode is indeed “reaching” the typedef: I put #error before and after the typedef and both errors are spit out by Xcode; however:

 

  1. Xcode isn’t really “consuming” the typedef: I changed it to “typedef GregorianChant *PascalStringPtr;” and Xcode did not complain about that at all – and I feel confident there’s no inherent C type of “GregorianChant”!!! J

 

 

So what the heck is going on here?!?!? 

 

I did some searching and found a posting (http://gcc.gnu.org/ml/gcc-help/2005-06/msg00097.html) about someone who had a similar experience and the issue was related to an X.h file including a Y.h file which itself then included X.h, etc.

 

I don’t have my code at this computer so I can’t test this out today.  My .h files are ALL protected with :

 

#ifndef  __FOO__

#define __FOO__

 

…

 

#endif

 

…which should preclude a lot (but not necessarily all) of nested and incestuous .h file inclusion problems.

 

Can anyone shed any light on this problem?  Is it indeed .h files including other .h files that then include the original .h file?

 

Is there any compiler setting I can play with to work around this?  Do I have to re configure my #includes?

 

Any insight is very much appreciated…

 

Thx,

Ando

 

 

 _______________________________________________
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: typedef problem in Xcode 2.2
      • From: "Clark Cox" <email@hidden>
  • Prev by Date: Re: I need clarification on limitations of integrating C++ with Obj C
  • Next by Date: Re: typedef problem in Xcode 2.2
  • Previous by thread: Re: I need clarification on limitations of integrating C++ with Obj C
  • Next by thread: Re: typedef problem in Xcode 2.2
  • Index(es):
    • Date
    • Thread