On Nov 19, 2006, at 1:02 AM, Sebastian Posch wrote: I get some sporadic build errors about missing headers in our project. This problem seems to occur ever since I switched from All-in-One to Condensed Layout in Xcode 2.4 but that's probably just a coincidence (It is not reproducible by just switching to a different layout)
I have a BSD C library project with header files in "~/Development/foo/include/". All headers in that directory are added to the Groups&Files, and I include all headers in the project with double quotes e.g. #include "foo.h" (and no spaces in paths)
The problem is that one out of a random 10-15 builds fails with a "error: foo.h: No such file or directory" for every #include directive in the project, although I didn't add/remove/modify any headers at all. I am then irritated by what could cause the build to fail and notice that it must be "that weird problem" again and just build the project again via Command-B or via the menu, without doing any other modification, and voila it will build just fine.
I am about to update to 2.4.1 but not sure if that will fix it. Any ideas?
It's unlikely as we've never heard of something like this happening, so we haven't fixed it in 2.4.1.
It might be helpful to us if you added "-v" to Other C Flags for a day or so, just long enough to catch one of the bad builds. Then when you hit the error, copy and paste the entire build transcript from the Build Results window into a text file, then attach it to a bug in bugreporter.apple.com. Rebuilding to get a correct build and attaching that would also help (and you might even be able to find the problem yourself by looking at the two side by side).
For your information, you don't need to add non-project headers to your project file in order to compile, just ensure that the path to them is in your Header Search Paths. (Having project headers in your project is useful for checking into SCM or copying to a distribution version at build time).
Note the issue with ~ is that it is evaluated every time in the context of the logged-in user. If for some reason your build is executed with elevated priviliges (for example, you do sudo xcodebuild from the command line), ~ will expand to a different value, and your build will fail. In cases like this it's best to use a Source Tree instead of a shell glob.
Chris
|