Re: Relative user path problem
Re: Relative user path problem
- Subject: Re: Relative user path problem
- From: Chris Espinosa <email@hidden>
- Date: Thu, 10 Apr 2008 10:48:33 -0700
On Apr 10, 2008, at 10:33 AM, Wade Williams wrote:
I've been searching the archives and can't find a solution to this
problem.
I have:
development/project/xcode_project
and
development/project/app/inc/main.h which says:
#include "../../lib/window/inc/app_window.h"
that is included by
development/project/app/src/main.cpp
and Xcode cannot find the file.
As I recall, this is because Xcode does not actually change the
working directory to the directory containing the source when it's
compiling.
I know some of the standard answers:
1) Change the include to just "app_window.h"
2) Move the source files underneath the Xcode project folder
3) Setup a source tree and have all paths reference that source tree.
None of those options are really options however. This is cross-
platform source, and there's no reason why we shouldn't be able to
use a relative path in our project.
I've tried setting a user header path to:
development/project/app/src
thinking that when Xcode tried to search that path for ../../lib/
window/inc/app_window.h it would find it, but that did not resolve
the issue.
Can someone remind me of how to fix this problem?
Try setting a user header path to $(SRCROOT)/development/project/app/
src.
It would be helpful (to you, primarily, but also to us) to add "-
v" (no quotes) to the Other C Flags and do a build. gcc will
helpfully dump out the entire list of directories it's searching.
Xcode gives gcc a leg up on finding files by use of a headermap.
Sources that have an external assumption (for example, that the cwd is
in a certain place at compile time, which is not a reliable cross-
platform expectation) may cause the headermap to be inaccurate. Set a
custom build setting USE_HEADERMAP = NO and Xcode will force gcc to
search for every header file every time.
Chris
_______________________________________________
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