• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Relative user path problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Relative user path problem (From: Wade Williams <email@hidden>)

  • Prev by Date: Xcode 3 + 10.3.9 + NSStrings
  • Next by Date: Re: Xcode 3 + 10.3.9 + NSStrings
  • Previous by thread: Relative user path problem
  • Next by thread: Re: Crash in dylib on Leopard, only on 64bit Intel
  • Index(es):
    • Date
    • Thread