S.Schweng
S.Schweng

Reputation: 81

Xcode: Undefined symbols for architecture i386

Honestly, I'm quite inexperienced in OBJ-C. I've looked for a solution on Stack Overflow and other pages very hard but I'm still not able to fix my issue. For my final project in school I have to program an iOS-App which should be able to display data from a MySQL-database. I checked out an article of Code with Chris (http://codewithchris.com/iphone-app-connect-to-mysql-database/#creatingphpservice) and tried to modify it for my specifications from school.

So here's my error:

Undefined symbols for architecture i386:
"_OBJC_CLASS_$_Data", referenced from:
objc-class-ref in HomeModel.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

As I already found out this means something like my HomeModel-File wants to access to my "Data"-class which I defined in "Data.h". But I have already imported "Data.h" into my "HomeModel.m" (and also to "HomeModel.h" although this is unnecessary I think).

Does anyone know how to fix this?

PS: I already checked the "Compile Sources" of my project.

Upvotes: 5

Views: 2148

Answers (2)

S.Schweng
S.Schweng

Reputation: 81

Thanks a lot for your answers and comments!

As I already mentioned I'm really no expert in Obj-C and of course it was a very stupid mistake...

My "Data.m" was completely empty.

I just had to add these few lines:

#import "Data.h"

@implementation Data
@end

Again: Thanks for spending your time on my "problem"! haha

Upvotes: 2

jeprubio
jeprubio

Reputation: 18022

I had the same issue and this warning disappeared after changing the Build Settings > Architectures to "Standard architectures" and Build Settings > Valid Architectures to "armv7 armv7s armv8 arm64" for all the projects and targets that my project had. Hope this helps.

Upvotes: 3

Related Questions