[zeromq-dev] zmq on Android via NDK

Florian Eckerstorfer Florian.Eckerstorfer at gmx.net
Tue Mar 19 09:28:55 CET 2013


Yeah I followed the rules how to compile the libzmq for android, and it
worked. I get a static library. I tried to change the ./configure line, but
I always get a static library, so I think the library should work. But how
can I link it correctly in my Android Project. How can I use the prebuilt
library. 
I' using the cpp version of zmq in my android project and in the zmq.hpp
there are all the undefined references.
So in other words, what do I have to do to make the zmq.hpp ready to work in
my android project.

Von:  Victor Perron <victor at iso3103.net>
Antworten an:  <victor at iso3103.net>, ZeroMQ development list
<zeromq-dev at lists.zeromq.org>
Datum:  Dienstag, 19. März 2013 09:08
An:  Florian Eckerstorfer <Florian.Eckerstorfer at gmx.net>
Cc:  Min <miniway at gmail.com>, ZeroMQ development list
<zeromq-dev at lists.zeromq.org>
Betreff:  Re: [zeromq-dev] zmq on Android via NDK

Then restrict yourself to the description for libzmq.so alone, nope ?
Removing --enable-static --disable-shared in the ./configure line should do
the trick maybe.

On Tue, Mar 19, 2013 at 12:30 AM, Florian Eckerstorfer
<Florian.Eckerstorfer at gmx.net> wrote:
> The Problem really is, that I have the libzmq.a compiled, this one should
> work, and I don't need the whole Java Stuff, but I get the I think it's linker
> errors, like the one I posted before.
> I have seen your description of how to compile the whole stuff, but I don't
> think I need the libjzmq and the .jar file.
> 
> Von:  Victor Perron <victor at iso3103.net>
> Antworten an:  <victor at iso3103.net>, ZeroMQ development list
> <zeromq-dev at lists.zeromq.org>
> Datum:  Dienstag, 19. März 2013 01:17
> An:  Min <miniway at gmail.com>
> Cc:  ZeroMQ development list <zeromq-dev at lists.zeromq.org>
> Betreff:  Re: [zeromq-dev] zmq on Android via NDK
> 
> @min: I would also recommend jeromq to anybody, but Florian seems to actually
> really need the native library for a native project...
> 
> On Mon, Mar 18, 2013 at 4:57 PM, Min <miniway at gmail.com> wrote:
>> Hi,
>> 
>> Please try using jeromq. When I tested it with the Nexus and Galaxy Tab, It
>> worked well.
>> 
>> Thanks
>> Min
>> 
>> 2013년 3월 19일 화요일에 Victor Perron님이 작성:
>>> Well I had designed a collection of scripts to automate that process, maybe
>>> you could find some inspiration there.
>>> https://github.com/vperron/android-jzeromq
>>> As a matter of fact those scripts are mostly useful to remember the exact
>>> compilation flags you need to have all the symbols resolved right, which
>>> seems to be your issue.
>>> I wasn't using those 'Android-specific'  NDK makefiles though, was more
>>> relying on the generated standalone ARM toolchain and using standard
>>> autotools for the rest.
>>> Good luck,
>>> 
>>> On Mon, Mar 18, 2013 at 3:13 AM, Florian Eckerstorfer
>>> <Florian.Eckerstorfer at gmx.net> wrote:
>>>> 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'
>>>> 
>>>> _______________________________________________
>>>> 
>>>> zeromq-dev mailing list
>>>> zeromq-dev at lists.zeromq.org
>>>> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>>>> 
>>> 
>>> 
>>> 
>>> -- 
>>> Victor
> 
> 
> 
> -- 
> Victor
> _______________________________________________ zeromq-dev mailing list
> zeromq-dev at lists.zeromq.orghttp://lists.zeromq.org/mailman/listinfo/zeromq-dev



-- 
Victor
_______________________________________________ zeromq-dev mailing list
zeromq-dev at lists.zeromq.org
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130319/e9e4bff1/attachment.htm>


More information about the zeromq-dev mailing list