XCode 2.2: Header changes being ignored?

Discussion in 'Mac Programming' started by Thomas Harte, Feb 11, 2006.

  1. Thomas Harte macrumors 6502

    Nov 30, 2005
    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?
  2. HiRez macrumors 603


    Jan 6, 2004
    Western US
    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.
  3. Pitfall macrumors newbie

    Jul 18, 2002

    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.
  4. superbovine macrumors 68030


    Nov 7, 2003
    yeah, the solution is to do a clean build. I don't think there is a way around it.
  5. erpman macrumors newbie


    May 14, 2006
    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!



Share This Page