Re: Partial includes syntax
Re: Partial includes syntax
- Subject: Re: Partial includes syntax
- From: Andreas Grosam <email@hidden>
- Date: Fri, 2 Sep 2005 07:23:05 +0200
On 01.09.2005, at 23:14, Rush Manbert wrote:
Philippe Casgrain wrote:
I am porting our project from CW to Xcode, and one problem I am
experiencing is this. On disk, we have the following structure:
Project/
Document/
Document.h
In our source code, if we type:
#include "Document/DocEvent.h"
that does not compile (error: Document/DocEvent.h: No such file or
directory).
But if we replace that line with:
#include "DocEvent.h"
Then everything is fine. Xcode can find the file, I can Cmd-D on the
file name to open it. But it won't let us #include with a prefix.
Is there a flag we can set? This code is cross-platform, so it has to
build using CW, gcc and Visual C++...
Philippe,
I assume you mean "Document.h", given the directory structure you
showed.
I think all you need is a new include path in your Xcode project that
points to the Project directory. Once you do that the first form
(#include "Document/Document.h") should work. I do this in my projects
and it works just fine.
Well, XCode finds the headers, but the compiler doesn't.
I think, you have to specify the path to the xxx/Project/Document
folder in the Header Search Path build settings.
For instance, if your Project folder is located in ~/Develop/ you may
add (space seperated) the following path string in the Header Search
Path:
$(HOME)/Develop/Project/Document
Alternatively (prefered) I would define a "Source Tree" in the
preferences which points to your folder Project, e.g.
PROJECT is defined as $(HOME)/Develop/Project
then, in the Build Settings, specify the search path as
$(PROJECT)/Document
Furthermore, so that **XCode** can find easily the sources and headers
- even when you move your project folder or the XCode project file
relative to your project - specify the search paths to files relative
to the source tree PROJECT using the Info Panels for Groups or Info
Panels for files.
Andreas
- Rush
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
_______________________________________________
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