Adding source files to XCode - MacRumors Forums
Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Apr 7, 2009, 03:06 PM   #1
jsnuff1
macrumors 6502
 
Join Date: Oct 2003
Location: NY
Send a message via AIM to jsnuff1
Adding source files to XCode

I am using an open source project that will be part of my application that I need to add to xcode and have it compile.

I take the src folder and add it to XCode and there are two options..

Recursively create groups for any added folders
This creates a yellow folder in XCode and attempts to compile, but XCode cannot find any of the header file paths...

the includes in the source files look like this,

#include <checker/impl/utils/Logging.h> and i get the error no such file or directory


The other option adds the source as a blue folder, but does not compile the code, simply just copies the source folder to the target.

So whats the proper way of adding this, and keeping all the folder directories intact and having XCode know where everything is?
jsnuff1 is offline   0 Reply With Quote
Old Apr 8, 2009, 02:35 PM   #2
szymczyk
macrumors regular
 
Join Date: Mar 2006
When adding folders of source code files, you want to recursively create groups. As you noticed, creating folder references is for folders you want copied to the application bundle, such as folders of data, graphics, and audio files.

What you need to do is add a search path for your header files. In Xcode 3, choose Project > Edit Project Settings to modify your project's build settings. In the Search Paths collection are settings to add search paths for header files, libraries, and frameworks.
__________________
Mark Szymczyk
Author, Xcode Tools Sensei
http://www.meandmark.com
szymczyk is offline   0 Reply With Quote
Old Apr 9, 2009, 04:50 PM   #3
jsnuff1
Thread Starter
macrumors 6502
 
Join Date: Oct 2003
Location: NY
Send a message via AIM to jsnuff1
well I found the problem

changing

#include <checker/impl/utils/Logging.h>

to simply

#include "Logging.h"

fixes the problem when I added the search path...unfortunately there are hundreds of header/source files that I would have to change..so how can I make it work with the first format?

Last edited by jsnuff1; Apr 9, 2009 at 04:56 PM.
jsnuff1 is offline   0 Reply With Quote
Old Apr 9, 2009, 06:13 PM   #4
kainjow
Moderator emeritus
 
kainjow's Avatar
 
Join Date: Jun 2000
Reread szymczyk's second paragraph.
kainjow is offline   0 Reply With Quote
Old Apr 9, 2009, 08:33 PM   #5
jsnuff1
Thread Starter
macrumors 6502
 
Join Date: Oct 2003
Location: NY
Send a message via AIM to jsnuff1
I have already added the proper search paths. The problem is all the source files have their dependancies in the format of my first example on my post above. This causes XCode to not be able to locate them. Rewriting that #include line with simply just the name in quotations (without any path information) makes XCode understand where it is.

Problem is there are hundreds of these lines I have to change, and Id rather not do all that work if there is a way to make it work with the first format.
jsnuff1 is offline   0 Reply With Quote
Old Apr 9, 2009, 09:48 PM   #6
harry65
macrumors member
 
Join Date: Aug 2008
When you added your search path for your header files, what path did you use? Was it something like '/base/directory/checker/impl/utils'? If so, I wonder if it would work if you just used '/base/directory'. I'm not very familiar with XCode, but it seems as though the compiler is looking too far into the path (it finds Logging.h so it's looking at the checker/impl/utils directory).
harry65 is offline   0 Reply With Quote
Old Apr 10, 2009, 01:13 AM   #7
jsnuff1
Thread Starter
macrumors 6502
 
Join Date: Oct 2003
Location: NY
Send a message via AIM to jsnuff1
no, I just point it at the base source folder.

I guess it just comes down to understanding what <> vs "" means for #include's

Can anyone explain the difference?
jsnuff1 is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Resolved: Xcode 5: How to search in your app's source code moonman239 iPhone/iPad Programming 0 Mar 6, 2014 11:55 AM
Xcode gets the wrong path when adding files printz Mac Programming 1 Mar 6, 2014 04:01 AM
Adding an Image in Xcode 4.5 Blakeasd OS X 10.8 Mountain Lion 1 Dec 14, 2012 08:32 PM
Large open source Xcode project for benchmarking theSeb Mac Programming 4 Sep 28, 2012 06:58 AM
Help with adding and subtraction in Xcode kingv84 Mac Programming 5 Jun 18, 2012 04:36 PM

Forum Jump

All times are GMT -5. The time now is 03:46 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC