I am trying to use RabbitMq in an iOS app. As recommended, I am using this Objective-C wrapper, which stipulates : There is nothing to build. Just include the source and header files into your Xcode project and link it againt librabbitmq-c. However, I have been unable to build the app so far. I am using the last stable versions available on GitHub.
1/ I have tried to include all files (both rabbitmq-objc and rabbitmq-c) in my project, and build as usual (as suggested here). After replacing a few types (uint8 into u_int8_t) and solving a few imports ("amqp.h" instead of < amqp.h>) as suggested by XCode, I ended up with this error : Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 254. I deep cleaned project, erased content of ~/Library/Developer/Xcode/DerivedData, but no luck.
2/ I have then tried to build rabbitmq-c with cmake via command-line :
mkdir build && cd build
cmake ..
cmake --build . --config Release
And then importing as a dynamic lib in my project. When linking in the project, XCode complains that building for iOS Simulator, but linking against dylib built for MacOSX file. I have read a few post on how to address this issue, but I am not sure exactly how to proceed.
3/ I have thus finally used the CMake.app for MacOS, setting the generator to XCode. I have imported the rabbitmq-c.xcodeproj built as a dynamic lib, and set the header path to the correct folder. After setting the Other linker flags to -ObjC -all_load, I still get an error : no such file or directory: '/Users/Guillaume/Library/Developer/Xcode/DerivedData/RabbitMQSandbox-bvhczedxhtejhxcwdqmdewzzexjj/Build/Products/Debug-iphonesimulator/librabbitmq.4.0.0.dylib'.
I am losing hope. Can somebody point me toward the right direction ?