FAQ: Compile problems when multiple headers in project have same name
FAQ: Compile problems when multiple headers in project have same name
- Subject: FAQ: Compile problems when multiple headers in project have same name
- From: Chris Espinosa <email@hidden>
- Date: Mon, 19 Apr 2004 11:03:22 -0700
On Apr 18, 2004, at 11:42 PM, Mark Rowe wrote:
I have a project which consists of source files in several
directories. In particular, the root directory contains a file named
Defines.h. Many files within the project include it by using the
following syntax:
#include "Defines.h"
In a subdirectory, Foo, there is another file named Defines.h. Files
within the Foo directory include Foo/Defines.h by saying:
#include "Foo/Defines.h"
The problem is that GCC appears to be including the wrong Defines.h in
the second case. Instead of including Foo/Defines.h, it is including
the project root directory's Defines.h. After playing with build
settings for a while, I noticed that removing the
"-Wp,-header-mapfile,/.../" portion of the compilation command line
solves the problem.
My questions are as follows:
* Am I doing something wrong?
* What can I do to make things work the way that I expect?
There are known problems with using multiple header files with the same
name. Xcode's built-in header caching mechanism can get confused. To
turn this off, Get Info on the affected target, go to the Build tab,
and add
USE_HEADERMAPS | NO
to the build settings. This defeats header path caching and should
make your target build correctly.
Chris
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.