Skip to main content
GameDev.net gamedev.net
🔒 Locked

XCode include path problem

Started by basement Feb 9, 2006 at 9:37 AM 4 replies 11.5k views
Original Post
basement
basement
I am porting a codebase from MS VisualStudio to XCode. The libraries header files are seperated like this:
-include
	-foo
		-foo.h
		-bar.h
	-baz
		-baz.h
	...
[Edit: Leading whitespace is removed by the forum unless you place it within a [code] block - Oluseyi] Throughout the source, header files are included like "#include ", "#include " I created a "include" group in XCode that added my headers recursively but I can't get it to compile unless I remove the subfolders from the #include directives (i.e. #include instead of ) This should be easy but I can't seem to figure out how to make it work in the XCode's funny ui. I added a header searchpath in XCode for the top-level "include" directory but that didn't change anything. I can't just change all #include directives either because that would break the build on Windows for other people. Anyone know how to fix this simple problem? [Edited by - Oluseyi on February 9, 2006 9:59:48 AM]
RichardS
RichardS
In your diagram, it looks like all the files are at the same level in the folder hierarchy.

You need to clarify how they are laid out.
Oluseyi
Oluseyi
Quote:
Original post by RichardS
In your diagram, it looks like all the files are at the same level in the folder hierarchy.

You need to clarify how they are laid out.

You've been a member since 2004. You should know that leading whitespace disappears unless escaped by [code]. Further, based on the paths specified in his include statement, you should have immediately seen what he was trying to describe.

[Sorry, I can't respond to the actual question. I've never used Xcode.]
basement
basement
Yeah sorry that came out wrong. Thanks for indenting :) Don't have access to the mac now so haven't found a solution yet.
RichardS
RichardS
From your description, It sounds like you're trying to do this by adding the headers themselves to the file listing on the left-hand side of the window, which doesn't actually change the include paths used by the compiler.

Select 'Edit active target 'x'' from the Project menu.
Choose the Build tab.
Choose "All Configurations" from the Configuration popup button.
Choose "Search Paths" from the Collection popup button.
Double click on the entry marked 'Header Search Paths'
Add the path to the top level include folder. You should not select 'recursive'.

These instructions assume you are using Xcode 2.2 or 2.2.1. It is different for older versions.
basement
basement
Yep, thanks, it worked. I am using XCode 2.1. For some reason it didn't work when I added the search path globally in the compiler settings.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.