How to include rabbitmq -c lib in my iOS project?

830 views
Skip to first unread message

Marco Lettieri

unread,
Mar 17, 2015, 1:42:19 PM3/17/15
to rabbitm...@googlegroups.com

Michael Klishin

unread,
Mar 17, 2015, 2:07:14 PM3/17/15
to rabbitm...@googlegroups.com, Marco Lettieri
Should not be any different from any other C library. 
--
MK

Staff Software Engineer, Pivotal/RabbitMQ

Marco Lettieri

unread,
Mar 17, 2015, 2:38:31 PM3/17/15
to Michael Klishin, rabbitm...@googlegroups.com

I included the c library... But when i include ufficial wrapper i can't compile because misses some header file. Can you explaim me how to import, which c library and wich Wrapper i have to use? Thanks

Alan Antonuk

unread,
Mar 17, 2015, 2:42:57 PM3/17/15
to Marco Lettieri, Michael Klishin, rabbitm...@googlegroups.com
In order to help you out: we need more information about what is missing, or any error messages you might get.

The recommendation is to use something like ios-cmake with CMake to generate the XCode project files for the static library, then link this library against whatever you're building.

-Alan

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Marco Lettieri

unread,
Mar 18, 2015, 7:03:46 AM3/18/15
to rabbitm...@googlegroups.com, lettier...@gmail.com, mkli...@pivotal.io
I followed your suggestes. Compiled with ios-Cmake and it generate an XCode project.
It generate some header and source code files, i suppose we have to import a .a lib to import in my exsistent project.
It's impossible to compile the generated xcode project.
Any ideas?

Marco Lettieri

unread,
Mar 18, 2015, 1:51:50 PM3/18/15
to rabbitm...@googlegroups.com, mkli...@pivotal.io
I can generate my lib.a file... ever exceptions in compiling... 32/64 bit errors, or unlinked exceptions...
Can you send me a compiled .a class lib?

Undefined symbols for architecture armv7:
  "_amqp_channel_close", referenced from:
      -[AMQPChannel close] in AMQPChannel.o
  "_amqp_login", referenced from:
      -[AMQPConnection loginAsUser:withPasswort:onVHost(inlove) in AMQPConnection.o
  "_amqp_open_socket", referenced from:
      -[AMQPConnection connectToHost:onPort(inlove) in AMQPConnection.o
  "_amqp_new_connection", referenced from:
      -[AMQPConnection init] in AMQPConnection.o
  "_amqp_maybe_release_buffers", referenced from:
      -[AMQPConsumer pop] in AMQPConsumer.o
  "_amqp_simple_wait_frame", referenced from:
      -[AMQPConsumer pop] in AMQPConsumer.o
  "_amqp_basic_publish", referenced from:
      -[AMQPExchange publishMessage:usingRoutingKey(inlove) in AMQPExchange.o
  "_amqp_set_sockfd", referenced from:
      -[AMQPConnection connectToHost:onPort(inlove) in AMQPConnection.o
  "_amqp_basic_consume", referenced from:
      -[AMQPConsumer initForQueue:onChannel:useAcknowledgements:isExclusive:receiveLocalMessages(inlove) in AMQPConsumer.o
  "_amqp_queue_bind", referenced from:
      -[AMQPQueue bindToExchange:withKey(inlove) in AMQPQueue.o
  "_amqp_queue_unbind", referenced from:
      -[AMQPQueue unbindFromExchange:withKey(inlove) in AMQPQueue.o
  "_amqp_queue_declare", referenced from:
      -[AMQPQueue initWithName:onChannel:isPassive:isExclusive:isDurable:getsAutoDeleted(inlove) in AMQPQueue.o
  "_amqp_exchange_declare", referenced from:
      -[AMQPExchange initExchangeOfType:withName:onChannel:isPassive:isDurable:getsAutoDeleted(inlove) in AMQPExchange.o
  "_amqp_destroy_connection", referenced from:
      -[AMQPConnection dealloc] in AMQPConnection.o

Alan Antonuk

unread,
Mar 18, 2015, 5:00:41 PM3/18/15
to Marco Lettieri, rabbitm...@googlegroups.com, Michael Klishin
I don't distribute binaries (sorry).

Try passing -DBUILD_SHARED_LIBS=False -DBUILD_STATIC_LIBS=True when running CMake.

Also the errors I'm interested in seeing are the ones when you attempt to compile rabbitmq-c.




Alfredo D'Andrea

unread,
Mar 19, 2015, 12:49:31 PM3/19/15
to rabbitm...@googlegroups.com, lettier...@gmail.com, mkli...@pivotal.io
Hi Alan.
I have tried to use  ios-cmake like you suggested, but I got the following errors by cmake, could you help me, the file that you suggested may not be compatible with xcode 6.2, where can I find one compatible for this version of xcode? Thank You

These  are cmake errors:

CMake Error at /Users/alfredo/Desktop/iOS.cmake:101 (message):
No iOS SDK's found in default seach path
/Developer/Platforms/iPhoneOS.platform/Developer. Manually set
CMAKE_IOS_SDK_ROOT or install the iOS SDK.
Call Stack (most recent call first):
/Applications/CMake.app/Contents/share/cmake-3.2/Modules/CMakeDetermineSystem.cmake:98 (include)
CMakeLists.txt:3 (project)

CMake Error: Could not find cmake module file: /Users/alfredo/Desktop/sorgenti4/CMakeFiles/3.2.1/CMakeCCompiler.cmake

CMake Error at CMakeLists.txt:3 (project):
The CMAKE_C_COMPILER:

gcc

is not a full path and was not found in the PATH.


But I tried to use a toolschain alternative, and I got this error from cmake you suggest a solution for this problem?

These  are cmake errors:

Toolchain using default iOS SDK: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.2.sdk

Found C inline keyword:

Looking for getaddrinfo

Looking for getaddrinfo - not found

Looking for getaddrinfo in socket

Looking for getaddrinfo in socket - not found

Looking for getaddrinfo in socket;nsl

Looking for getaddrinfo in socket;nsl - not found

CMake Error at CMakeLists.txt:80 (message):
Cannot find name resolution library (containing symbol getaddrinfo)

Configuring incomplete, errors occurred!

See also "/Users/alfredo/Desktop/sorgenti4/CMakeFiles/CMakeOutput.log".

See also "/Users/alfredo/Desktop/sorgenti4/CMakeFiles/CMakeError.log".



Il giorno martedì 17 marzo 2015 19:42:57 UTC+1, Alan Antonuk ha scritto:
ios.toolchain.xcode.cmake

Alan Antonuk

unread,
Mar 20, 2015, 2:11:23 AM3/20/15
to Alfredo D'Andrea, rabbitm...@googlegroups.com, Marco Lettieri, Michael Klishin
I can't help you much with finding a version of ios-cmake that works with XCode 6.2

I do see a bug in the CMakeLists.txt, that getaddrinfo isn't correctly detected.  Try building from the branch referenced in this PR https://github.com/alanxz/rabbitmq-c/pull/251 and see if that helps.

-Alan

Alfredo D'Andrea

unread,
Mar 20, 2015, 4:34:49 AM3/20/15
to rabbitm...@googlegroups.com, alfr...@gmail.com, lettier...@gmail.com, mkli...@pivotal.io
Hi Alan.
I tried to incorporate the changes you recommended in the file CMakeLists.txt, but cmake gives me this error:

Toolchain using default iOS SDK: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.2.sdk

Found C inline keyword:

Looking for htonll

Looking for htonll - not found

Looking for clock_gettime in rt

Looking for clock_gettime in rt - not found

Could NOT find POPT (missing: POPT_INCLUDE_DIR POPT_LIBRARY)

Could NOT find XMLTO (missing: XMLTO_EXECUTABLE)

Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)

Looking for include file pthread.h

Looking for include file pthread.h - not found

Could NOT find Threads (missing: Threads_FOUND)

CMake Error at /Applications/CMake.app/Contents/share/cmake-3.2/Modules/FindPackageHandleStandardArgs.cmake:138 (message):
Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
system variable OPENSSL_ROOT_DIR (missing: OPENSSL_LIBRARIES
OPENSSL_INCLUDE_DIR) (Required is at least version "0.9.8")


Call Stack (most recent call first):

/Applications/CMake.app/Contents/share/cmake-3.2/Modules/FindPackageHandleStandardArgs.cmake:374 (_FPHSA_FAILURE_MESSAGE)
/Applications/CMake.app/Contents/share/cmake-3.2/Modules/FindOpenSSL.cmake:334 (find_package_handle_standard_args)
CMakeLists.txt:245 (find_package)

Alan Antonuk

unread,
Mar 20, 2015, 10:48:06 AM3/20/15
to Alfredo D'Andrea, rabbitm...@googlegroups.com, Marco Lettieri, Michael Klishin
Add -DENABLE_SSL_SUPPORT=False to the CMake invocation (or provide OpenSSL compiled for iOS).

Winston

unread,
Mar 31, 2016, 12:53:34 AM3/31/16
to rabbitmq-users
Hi,
There is a easier way.
Hope that helps.

在 2015年3月18日星期三 UTC+8上午1:42:19,Marco Lettieri写道:
 

LUKALAPU SANTOSH RAO

unread,
Jan 20, 2017, 12:43:36 AM1/20/17
to rabbitmq-users


hi ,
i am santosh
I was compiled rabbitmq c client for arm target board. But i got following errors .Please give me a hands
 
/home/adya/Desktop/RabbitMQ/rabbitmq-c-master/librabbitmq/amqp_openssl_hostname_validation.h:34:28: fatal error: openssl/x509v3.h: No such file or directory

Karl Nilsson

unread,
Jan 20, 2017, 4:28:23 AM1/20/17
to rabbitm...@googlegroups.com
Hi,

If you are targeting iOS would our Obj-C client not work for you?


Cheers
Karl

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Karl Nilsson

Staff Software Engineer, Pivotal/RabbitMQ
Reply all
Reply to author
Forward
0 new messages