• 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: C++ Headers in /usr/include
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C++ Headers in /usr/include


  • Subject: Re: C++ Headers in /usr/include
  • From: Trenton Schulz <email@hidden>
  • Date: Fri, 17 Feb 2006 22:59:22 +0100


On Feb 17, 2006, at 7:22 PM, Rush Manbert wrote:

Trenton Schulz wrote:
There are at least three ways I've found to solve this problem and make things compile OK.
* If I move the headers out of /usr/include and update my include path
* If I preprocess the file and comment out all the "# XX" references
* If I put 'extern "C++"' around the class definitions in the include files.
I guess I'm wondering why having the headers in /usr/include/Blah causes this error when moving them makes them work fine or why I have to protect them if they are under /usr/include. Also is extern C++ standard or should I protect this as well?
I'm just a little confused and curious :)
Thanks in advance,
The most likely explanation is that at some point you modified the headers as described in your second or third option above, then moved those modified headers somewhere else. Now when you perform the first option (move the current headers and change the include paths) you have another include path that is searched first, and the compiler is finding the modified headers on that path.

I know this sounds too stupid to be true, but don't dismiss it out of hand. Pick one of the header file names and search for it in the Finder, searching all of your disks. My guess is that you will find at least one copy in an unexpected location.

No, I tried this out on separate machines with "fresh" includes and it still happened. I also did the Finder/Spotlight search on my development machine and "took care of" any old headers. Same thing. / usr/include seems to be a key.



Another (probably better) approach is to perform your first step (move headers and change paths), then open one of your failing sources and have Xcode preprocess it for you. Preprocess is available at the bottom of the Build menu. When it finishes, it pops up a window that contains the preprocessed source. You can see how the headers expanded, and it also seems to display the full path names to the header and source files that it used. Check the paths that are shown.

We've done that and there's nothing strange there. (that's why we were so puzzled about removing the preprocessor comments, we wanted to see where the error was in the preprocessed file, but the file is fine without the # directives to the original file). It seems that there is some unspoken rule for C++ headers in /usr/include, I was just hoping someone would speak out on it :)


-- Trenton

_______________________________________________
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: C++ Headers in /usr/include
      • From: Glen Low <email@hidden>
References: 
 >C++ Headers in /usr/include (From: Trenton Schulz <email@hidden>)
 >Re: C++ Headers in /usr/include (From: Rush Manbert <email@hidden>)

  • Prev by Date: Re: Symbols/Path names in built app
  • Next by Date: Re: __rlwinm weirdness
  • Previous by thread: Re: C++ Headers in /usr/include
  • Next by thread: Re: C++ Headers in /usr/include
  • Index(es):
    • Date
    • Thread