[zeromq-dev] zmq on Android via NDK
Florian Eckerstorfer
Florian.Eckerstorfer at gmx.net
Mon Mar 18 11:13:01 CET 2013
I am developing on a MacBook Pro with OSX 10.7.5. I followed the steps from
the http://www.zeromq.org/build:android to build a static zmq.a Library,
unfortunately i can't build the whole Java-stuff, because I am always
getting an error at the configure step, but that's not the Problem.
I only need the c-stuff, because I'm developing native without java and just
wrap it.
The thing is, I take the library and the zmq.h and zmq_utils.h and put them
into my uni-folder in my Android project, then I add the the Library in my
Android.mk-file. Because of al the goggling I've done I tried it in a lot of
different ways, but none of them seem to work. Currently I do it this way:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := ImageBabbleJNI
LOCAL_SRC_FILES := imagebabbleJNI.cpp
LOCAL_LDLIBS += -llog -lm -ljnigraphics
LOCAL_CPPFLAGS = -std=gnu++11 -fpermissive -fexceptions
-D__GXX_EXPERIMENTAL_CXX0X__
LOCAL_STATIC_LIBRARIES += libzmq
include $(BUILD_SHARED_LIBRARY)
So the static library should work. In my project I am using the zmq.hpp also
and that's where all the errors are. A lot of undefined references
jni/core.hpp:178: error: undefined reference to 'zmq_strerror'
jni/zmq.hpp:78: error: undefined reference to 'zmq_strerror'
jni/zmq.hpp:258: error: undefined reference to 'zmq_term'
jni/zmq.hpp:74: error: undefined reference to 'zmq_errno'
jni/zmq.hpp:119: error: undefined reference to 'zmq_msg_init_size'
jni/zmq.hpp:317: error: undefined reference to 'zmq_close'
jni/zmq.hpp:369: error: undefined reference to 'zmq_msg_send'
jni/zmq.hpp:372: error: undefined reference to 'zmq_errno'
jni/zmq.hpp:200: error: undefined reference to 'zmq_msg_data'
jni/zmq.hpp:149: error: undefined reference to 'zmq_msg_close'
jni/zmq.hpp:149: error: undefined reference to 'zmq_msg_close'
jni/zmq.hpp:149: error: undefined reference to 'zmq_msg_close'
jni/zmq.hpp:149: error: undefined reference to 'zmq_msg_close'
jni/zmq.hpp:112: error: undefined reference to 'zmq_msg_init'
jni/zmq.hpp:193: error: undefined reference to 'zmq_msg_copy'
jni/zmq.hpp:200: error: undefined reference to 'zmq_msg_data'
jni/zmq.hpp:258: error: undefined reference to 'zmq_term'
jni/zmq.hpp:232: error: undefined reference to 'zmq_init'
jni/zmq.hpp:285: error: undefined reference to 'zmq_socket'
jni/zmq.hpp:340: error: undefined reference to 'zmq_bind'
jni/zmq.hpp:200: error: undefined reference to 'zmq_msg_data'
collect2: error: ld returned 1 exit status
I'm kind of stuck on this problem since the last 5 days and I don't know
what to do. As I mentioned earlier I tried all the different ways to include
the static lib, but none of them did work.
I hope you can help me
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130318/c6d7cbd7/attachment.htm>
More information about the zeromq-dev
mailing list