jeremy-w/objc-zmq

How to use it for iphone

Closed this issue · 9 comments

i can't built it for iphone-os,can you help me?
xcode give me a Warning:
ld: warning: in /Users/username/Projects/ProjTest/SuperDemo/Trunk/Test2/libzmq.a, file was built for unsupported file format which is not the architecture being linked (i386)

Thanks

I ran into the same thing. easiest way around it is to pull these source files into your ios project and build alongside your ios app. there are only a few files in this project, so it's really really straightforward that way.

Doesn't it also mean compiling libzmq for the iPhone? ZMQSocket.h imports zmq.h.

yes, but if you use hombrew to install zmq, then that work has already been done for you. just locate libzmq and link to it in your xcode project.

One gotcha -- you may have to use "brew install zmq --universal" (or somesuch) in order for it to pack a fat binary version of the library so it'll work with i386 as well as x86_64.

Nice to know. I've been meaning to try homebrew. However, the iPhone needs the lib to be built for arm7 (i386 will work on the simulator). Not having used homebrew I'm guessing it doesn't do that (I'm off to the homebrew web site now, though).

@cswank any luck?

No, I tried putting all the libzmq code and the objective-c zmq code in my xcode project, but then there is a problem with platform.hpp getting generated from platform.hpp.in.

I think I need to figure out how to make a platform.hpp by hand that works for the iphone.

On Nov 16, 2011, at 5:46 PM, Bob wrote:

@cswank any luck?


Reply to this email directly or view it on GitHub:
#5 (comment)

Closing this issue, since the problem is with zmq itself (specifically, building libzmq for arm), not objc-zmq.

I've been looking around for most of a day now and it's not really straightforward getting zeromq to run on iPhone. Don't you think that objc-zmq's utility is somewhat reduced if it is that difficult to get running on iOS?

I used ZeroMQ on the desktop, not on the iPhone. If I find myself using it under iOS, I'll add iOS support myself then. It sounds like that will involve working with the ZeroMQ developers in order to make their build process more friendly to cross-compiling.

Until that time, pull requests are accepted.