tags:

views:

17

answers:

1

I am new to Xcode and have just gotten to the point where I am starting to build up a few files that I would like to include in future projects. Currently I am importing the file ...

#import "/Users/Gary/Documents/Xcode/FG_Include/FG_FloatFlip.h"

into my project at...

/Users/Gary/Documents/Xcode/mddStructure_PROJ/mddStructure.m

However I am getting the following error when I try to build.

Undefined symbols:
"_FG_FloatFlip", referenced from:
_main in mddStructure_PROJ.o
ld: symbol(s) not found

I was initially thinking that importing the file would be all I needed, although now I am thinking I might need to do something extra in Xcode to use functions in this external file, maybe linking?

gary

+1  A: 

Did you add FG_FloatFlip.h to your Xcode project? I'm pretty sure Xcode only "finds" files added directly to the project. Try dragging the file to your Xcode window, and change it to simply #import "FG_FloatFlip.h".

Chris Long
I did not add it to the current project, do I just need to add the *.h or the *.m too?
fuzzygoat
Yeah, every file you want to use should be added to the project. You don't need to move them to the actual project directory though; Xcode works independently of filepaths.
Chris Long
Thanks Chris, thats perfect, I just did not realise that I needed to add them to the project. Many thanks again.
fuzzygoat