0

I am trying to integrate the simulator static library of Redis into my iOS project and have done the following things.

  1. drag and drop the static library into my project folder
  2. Add header search path in the build settings
  3. Check whether the static library is added into the build phases in settings.
  4. Set the header search path
  5. Set the other linker flags setting to "-all_load"

I am not sure where i have gone wrong but am geting the following error while compiling it.

enter image description here

Any help in this regard is greatly appreciated.

A for Alpha
  • 2,904
  • 8
  • 42
  • 76
  • generally this happens when you are using some classes without adding their frameworks to project. please check once which frameworks are necessary for Redis. – Mahesh Agrawal Mar 24 '15 at 09:31
  • Its working quite well when i run it on the device, but its giving me trouble on simulator... – A for Alpha Mar 24 '15 at 10:11

2 Answers2

0

I was also getting such errors and figured out that adding .m files in "Build Phase" -> "Compile Sources" for the target fixed my problem.

Actually this happens if we miss to tick the Target Name in "Add to targets" name while adding any new library to it. (For your case, after drag and drop you might have seen a dialog box with options to copy items if needed, Add to target etc.)

Finally build and run. Hope this solves your problem!

eracube
  • 2,484
  • 2
  • 15
  • 18
0

The static library which you are dragging is not build for i386 architecture(simulator), try running your app on device, or build for device. Basically your app with the corresponding library will work on all such architectures for which it is built(armv7, armv64).

If you want to use the library and build your app on the simulator you need the static library which is also built for i386. And this could be provided by the developer of the static library.

Basically a fat(static library) file is created using static libraries for i386 and armv7(any required architectures) and shipped with the SDK of the static library which works on simulator as well as device.

The fat file is created by executing a lipo command on individual architecture static libraries.

Sanjay Mohnani
  • 5,947
  • 30
  • 46
  • Im pretty sure that i have added the static library meant for simulator. Atleast that's what their GITHUB page says – A for Alpha Mar 24 '15 at 10:01
  • Apart from that, there is another library given by the dev for device and its working absolutely fine.. The issue persists only with the simulator – A for Alpha Mar 24 '15 at 10:41
  • yes that's what my point is that the library is built only for device architecture and it's not being built for i386(the simultor), that's why it's complaining ld: symbol(s) not found for architecture i386 – Sanjay Mohnani Mar 24 '15 at 10:49