• 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: Source file compiles on its own, but not when building the target
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Source file compiles on its own, but not when building the target


  • Subject: Re: Source file compiles on its own, but not when building the target
  • From: Dan Korn <email@hidden>
  • Date: Tue, 24 Jun 2008 13:29:23 -0500

On Jun 23, 2008, at 9:21 PM, Ken Thomases wrote:
The only difference I see between the two compile commands is that one targets the i386 architecture and the other targets the ppc architecture.

There may be architecture- (or endianness-) sensitive conditional compilation. The error would appear to be in the PowerPC/Big-endian code.

Thanks Ken, I didn't catch that right away. However, there's nothing architecture- or endianness-specific in the code where the error is generated; the compiler just seems to be confused about a typedef, as if it wasn't even there.


The other thing that's different between the two compile commands is the location of the cached precompiled header:

-include /Library/Caches/com.apple.Xcode.502/SharedPrecompiledHeaders/ FPUnicodeUIPrefixMacDebug-eczjrrigtxqlvxdvbotnumsqsskg/ FPUnicodeUIPrefixMacDebug.h

-include /Library/Caches/com.apple.Xcode.502/SharedPrecompiledHeaders/ FPUnicodeUIPrefixMacDebug-cfsogxggxszpudfpabfgjpqmfpql/ FPUnicodeUIPrefixMacDebug.h

Aha! When I remove these cached files and build again, everything is fine. No code changes at all.

I continue to have similar problems in other projects, where I do a Clean (with the "Also Remove Precompiled Headers" box checked) and rebuild the project, but it's still using some cached precompiled header with information that doesn't match the original header file, and I get compile errors that I can't reproduce by compiling or preprocessing individual source files. This observed behavior seems to contradict the information here:
<http://developer.apple.com/documentation/DeveloperTools/Conceptual/XcodeUserGuide/Contents/Resources/en.lproj/05_09_bs_speed_up_build/chapter_37_section_2.html >


(Although, I'm using Xcode 2.5, and the latest documentation is presumably for Xcode 3.0, so it's hard to say. Not knowing whether the online documentation applies to the version of Xcode and associated tools that you're actually using is an ongoing problem. That "other" IDE vendor's online documentation always has a handy "Applies To" or "This page is specific to" note. But I suppose that's another topic.)

So, several questions:

1. Why does Xcode cache the precompiled headers, in such a way that even if I do a Clean, remove the build folder, and quit and restart Xcode, those cached files are still present? How can I get it to stop using the cache, or at least clear it, short of removing the files manually from the Terminal?

2. How can I get Xcode to compile or preprocess my source file for all architectures (or any specific architecture) in a Universal Binary target, short of doing a full build?

3. Can an Xcode precompiled header include the already precompiled header from another project or target, like in CodeWarrior? How would that be accomplished?

Maybe I'm too used to other compilers and IDEs, but I fully expect that when I compile a file, that's the same atomic operation that's happening when I build the entire Target, and I should see the same messages. Likewise, the "preprocess" command is an excellent way to diagnose compile errors, but only if it actually preprocesses the code that's producing the error.

Thanks,
Dan

_______________________________________________
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


References: 
 >Source file compiles on its own, but not when building the target (From: Dan Korn <email@hidden>)
 >Re: Source file compiles on its own, but not when building the target (From: Ken Thomases <email@hidden>)

  • Prev by Date: XCode 3.1 function popup does not work for Obj-C implementation files
  • Next by Date: Re: Project templates
  • Previous by thread: Re: Source file compiles on its own, but not when building the target
  • Next by thread: how to pass parameters to main() function through xcode?
  • Index(es):
    • Date
    • Thread