jimbob
jimbob

Reputation: 3298

Undefined symbols for architecture i386: "_OBJC_CLASS_$_Barcode", referenced from: objc-class-ref in

I am trying to integrate a QR code generating library in to my App.

the QR generator library is:

https://github.com/kuapay/iOS-QR-Code-Generator

I guess I must have integrated it wrong as I am getting this error:

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

What is most likely to be causing this?

Upvotes: 2

Views: 14034

Answers (5)

MD Aslam Ansari
MD Aslam Ansari

Reputation: 1565

I have fixed my issue by first changing the target to a library and pressed "CMD + B", which will build the all the library file. Then changing back to main target to compile and run on the device.

Note: I am using cocoapods and also have my own custom dynamic library in my project.

Upvotes: 1

wtorsi
wtorsi

Reputation: 732

Clean your DerivedData folder, this helps me

mv ~/Library/Developer/Xcode/DerivedData ~/Library/Developer/Xcode/DerivedData.old

Upvotes: 0

Hemanshu Liya
Hemanshu Liya

Reputation: 611

I solved the same issue by going to Xcode Build settings and in Architecture changed the standard architecture to :-

$(ARCHS_STANDARD_32_BIT)

Upvotes: 0

AliBoyraz
AliBoyraz

Reputation: 98

My problem is solved like that.
Please follow the directions:

TargetSettings -> Build Phases -> Compile Sources -> add your .m class  ->Build and Run

Upvotes: 8

Matt Wilding
Matt Wilding

Reputation: 20153

You're most likely linking against a version of the library that was compiled for the device (ARMv6/v7 architecture), while trying to compile for the simulator (i386 architecture). Try running on a device instead.

If running it on a device doesn't work either, then you may not be linking against the library at all, and you should verify that you see the library in your project's "Link Binary With Libraries" build phase.

Upvotes: 11

Related Questions