Getting "Undefined characters for i386 architecture" error in xcode when headers don't disappear

When I try to compile an iPhone app and run it in a simulator, I get errors complaining about undefined characters. All these characters correspond to classes that are included and missing in my project.

Example:

"_OBJC_CLASS_$_SHKFacebook", referenced from: objc-class-ref in FooAppDelegate.o objc-class-ref in FooLandingPageViewController.o objc-class-ref in FooAppDelegate.o 

but SHKFacebook.h is missing from the project.

Any ideas?

Thanks!

+4
source share
3 answers

I have several Xcode targets in this project, and when I added the files to the project, I added them to the wrong target, which made them invisible to the target I was trying to create.

+3
source

Is SHKFaceBook.h your file or library file?

If you click on the target of your project from the library and select the "Phase Assembly" tab, then select the "Link Binary Files to the Library" section and make sure that the library is added.

If SHKFaceBook.h is not from the library, then the fact that the .h file is included does not matter if the corresponding .m file is missing. If the .m file is already in your Xcode project, then on the "Phase Assembly" tab, select "Compile Sources" and make sure that the necessary files are there.

FYI is a communication error, a communication error is not the same as a compilation error. Source files can only be compiled with a header, but they cannot be linked and built without actual code. The header file is not code, it is more like a description of what is in the code.

+1
source

It seems to me that the library you linked to was compiled only for the hand platform, and not for the i386 - if you have a source, try to clean / rebuild?

0
source

Source: https://habr.com/ru/post/1415455/


All Articles