Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Thomas Harte

macrumors 6502
Original poster
Nov 30, 2005
400
4
I have found since upgrading to XCode 2.2 that if I change a header file then not all source files that refer to it are automatically rebuilt. What this means in effect is that if I change any header files I often have to clean & rebuild my entire project to avoid flakiness and crashing - especially when I change anything that is likely to effect the layout of my classes or structs in memory.

I mostly work with SDL or Allegro projects, so I almost never have any .pch files or other explicit references to precompiled headers in my projects.

It seems to me that the most likely culprit is the new JamTool thing that seems to be in charge of building things now.

Has anybody else seen similar problems? If so have they been able to fix them?
 

HiRez

macrumors 603
Jan 6, 2004
6,265
2,629
Western US
Thomas Harte said:
Has anybody else seen similar problems? If so have they been able to fix them?
I don't have a solution for that, but I have noticed that on 2.2.1 for me, it's not correctly setting the prefix header file name to match the name of the prefix file it generates when creating a new project, so I have to go in and set it manually in the project settings. It's initially setting the value to an environment variable--something like "$(GCC_PREFIX_FILE)"-- which is not correctly evaluating to the generated prefix file name that Xcode sets.
 

Pitfall

macrumors newbie
Jul 18, 2002
4
0
Spain
Workaround

If I modify some.hpp I either touch some.cpp, or insert a blank space at the beginning of some.cpp to force XCode to 'recompile' the header.
 

superbovine

macrumors 68030
Nov 7, 2003
2,872
0
Thomas Harte said:
I have found since upgrading to XCode 2.2 that if I change a header file then not all source files that refer to it are automatically rebuilt. What this means in effect is that if I change any header files I often have to clean & rebuild my entire project to avoid flakiness and crashing - especially when I change anything that is likely to effect the layout of my classes or structs in memory.

I mostly work with SDL or Allegro projects, so I almost never have any .pch files or other explicit references to precompiled headers in my projects.

It seems to me that the most likely culprit is the new JamTool thing that seems to be in charge of building things now.

Has anybody else seen similar problems? If so have they been able to fix them?

yeah, the solution is to do a clean build. I don't think there is a way around it.
 

erpman

macrumors newbie
May 14, 2006
1
0
uk
say it ain't so!

i'm a newcomer to xcode and have just started my first major project in it. i hit this problem with .cpp source files not re-compiling when i change a .h header file they include, so i headed over to these forums in the hope that there's just some option i've forgotten to set somewhere... but from the sounds of it i'm out of luck!

to be honest such lack of functionality is quite inexcusable: even in my relatively small project (30-odd files) it's quite a bind to manually re-save each file that includes a particular header after modifying said header, so i can't imagine what it must be like for much larger projects!

can anyone confirm that this functionality did infact work in previous versions of xcode? and if so, is there any sign that apple are aware of the bug and are on it's tail? (and if not, is there any way we can actually make this be the case?)

please, let's not let this slip under the carpet!

rgds,

erpman.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.