Re: XCode and C++ projects again
Re: XCode and C++ projects again
- Subject: Re: XCode and C++ projects again
- From: Chris Espinosa <email@hidden>
- Date: Tue, 27 Mar 2007 00:05:27 -0700
On Mar 26, 2007, at 11:52 PM, Livio Isaia wrote: I read again the XCode documentation and it seems that all I have to do (in order to use c++ files in a XCode project) is add them to the project itself. Well: in my case it doesn't work. For example: Let's say I have file main.m with statement #include <A/b/temp.h>, and file temp.h with #include <D/e/sub.h>. So I add the directories A and D to my project, right?
No, you add the path to the directories that contain A and D to your Header Search Paths. At this point XCode tells me it cannot find <A/b/temp.h>. I must change the statement <A/b/temp.h> to <temp.h> in order to let it find the file. Okay: the problem is that I must also change <D/e/sub.h> to <sub.h> and so on for all the involved files, but they are very many, and some of them are even protected.
Think of it this way: Xcode concatenates your #include path to each Header Search Path in turn until it finds a complete path that refers to a real file. If you add A/b to your Header Search Paths, then Xcode would look for A/b/A/b/temp.h, and it would not find it. Another example is file glx.h in Developer/SDKs/.../usr/X11R6/include/GL (which is protected): it presents #include <GL/gl.h> and this returns the same error (and gl.h is in the same directory - GL): perhaps I don't add the right directory to the project (I added GL)?
You add the parent directory of GL if the #include path starts with GL. It's strange that it has also #include <X11/Xlib.h>, which seems to work (X11 is in ../include/, beside GL)...
That all depends on what .. is relative to.
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