kaneyip
kaneyip

Reputation: 1267

How to add external source files to Xcode without drag/drop method?

I have an external folder "external" with .h and .m files.

The "External" folder has added to my xcode project like below: Project target > build Phase > Compile Source > + > Add Other > select the external folder > Checked Copy item if needed & select create folder reference.

However when compile its complain: Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_HelloWorld", referenced from: objc-class-ref in CustomObject.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

It work fine when i manual drag and drop the all files to project. However dislike the drag and drop methods. Is that an alternative way where xcode automatic compile with external source files without drag and drop.

Please help. Thanks in advance.

Upvotes: 2

Views: 3663

Answers (2)

Anjaneyulu Battula
Anjaneyulu Battula

Reputation: 1960

i added folder i donot know whether that is correct process or not so first remove that folder reference from your project, we can do in other way here i am adding steps

  • first inside your project editor, in left editor rightclick on one file that will show options like the followingenter image description here

  • click on Add Files to "your project name" then we have to choose folder and add.

Upvotes: 0

raurora
raurora

Reputation: 3673

With Xcode 5.1 and above, Apple has arm64 (64 bit architecture - x86_64) as part of Standard architectures. That means the projects using the default setting will be automatically build for arm64 also.

It seems that your project is not able to support 64-bit - you need to specifically set the architectures in build settings.

Project Targets >> Build Settings >> Architectures >> Standard architectures (armv7,armv7s)

enter image description here

Upvotes: -1

Related Questions