Domanda

I am using the RestKit to consume web services. RestKit worked fine until I tried add the libZSDK_API.a library (this library is to manage the zebra printers by Network or bluetooth)

Several Tutorials indicate this step to add the RestKit to iOS Project:

  • Add in "other linker flags" the value -ObjC

But this flag (-ObjC) cause compilation error when I added the library, When I remove this flag the iOS app compile correctly but when I execute the app is crashed because the Project does not have the -ObjC flag.

I'm getting this Compilation error:

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_Linea", referenced from:
      objc-class-ref in libZSDK_API.a(LineaBtPrinterConnection.o)
     (maybe you meant: _OBJC_CLASS_$_LineaBtPrinterConnection)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
È stato utile?

Soluzione

The Zebra API links to another API for Bluetooth communication thru the IPC Linea Sled device. The LineaBtPrinterConnection links to that library file (libdtdev.a). Normally, if you don't care about the BT communication thru the sled, you don't have to link that library in, but since you're adding that -ObjC flag, it's loading that file and looking for that library.

If you add the libdtdev.a library to your project, that error should go away. The library should be included in the download you got from Zebra under the "Demos" project folder. If you need to actually use the sled, depending on the firmware version of the sled, you may need a new version from IPC, which you can get if you sign up as a developer on their site.

Altri suggerimenti

I bet your app would build successfully for the device. The problem you're seeing is when you build for the simulator (which I can tell because it says "not found for architecture i386").

How are you building "libZSDK_API"? From source? If so, make sure you also build it for the simulator. If not, the vendor needs to include symbols for "i386" in the .a file they deliver.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top