2

I'm trying to add the hypen library to my Xcode iOS project and it has 4 files: hyphen.c, hyphen.h, hnjalloc.c, hnjalloc.h. I dragged them to my project and hit build, but I'm getting undefined symbols for architecture i386 errors. Am I supposed to take any other steps besides dragging them to my project?

3
  • Rename .c files to .m and check. Commented May 13, 2012 at 5:28
  • 2
    @SIGSEGV When or why would that ever work? Commented May 13, 2012 at 6:03
  • I think you need to use add file to ,not drag. and also need to check the real path of your project have files which you added Commented May 13, 2012 at 6:26

2 Answers 2

5

Make sure you've added them to the build target - including a file into the project without including in the build target can easily cause this error.

Sign up to request clarification or add additional context in comments.

3 Comments

You are assuming that @mohabitar is building and running for the simulator (which is likely). If that is correct, your answer is dead-on. If not, then there is something else amiss.
How do I add them to the build target?
In Xcode 4, you add it in the file inspector (open the file and press ⌘⌥1 if not already visible)
1

right click on the Source folder (top left where all the folder are) and check add. Then choose the files you wish to add. I tried drag&drop had problems with linker.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.