[zeromq-dev] Issue linking ZMQ static library into shared library for Android

Joe McIlvain joe.eli.mac at gmail.com
Fri Mar 6 18:17:40 CET 2015


Matthias,

I don't usually compile them as static, but you may be able to get some
ideas/help from using or looking at the scripts I added under
`builds/qt-android`of the zeromq repository.  I use these to compile for
use with Qt on android, but there's nothing really Qt-specific about them.
I only added them because the android scripts didn't work for me.  They
didn't seem to be maintained, but I didn't want to clobber something that
someone out there might be relying on.

I don't know a lot about the android toolchain because working with Qt
hides a lot of the platform-specific stuff from me, but I learned just
enough about the toolchain to make those scripts work and get them into the
CI for the repository.


On Fri, Mar 6, 2015 at 6:30 AM, Matthias Brzezinski <
Matthias.Brzezinski at gmx.de> wrote:

>  Hey,
> I'm having issues linking ZeroMQ into my shared library for Android.
>
> I followed the steps on http://zeromq.org/build:android to build the
> static library. I tried it with the recommended NDKr8 but also tried it
> with the NDK10d. I've build the static library for arm with the official
> ndk-toolchain.
> Afterwards I try to link thoose libraries into my shared library to
> compile a bunch of cpp files.
> I've successfully compiled and linked different static libraries into my
> projects so I'm pretty confused why the linker throws the Error when I work
> with ZeroMQ. I've omitted the other working libraries.
> My Android.mk:
>     http://pastebin.com/N7gueqre
>
> My Application.mk:
>     http://pastebin.com/nNgCYM2F
>
> In both code blocks I've ommited everything that is not necessary for
> solving this issue. The error message stays the same. I've tried to build
> the shared library under windows and later under debian and ubuntu. The
> error message is:
>
>
> /tmp/android-ndk-r10d/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld:
> error: ./zmq/lib    /libzmq.a(libzmq_la-zmq.o): incompatible target
>     collect2: error: ld returned 1 exit status
>     make: *** [obj/local/armeabi/libzmqTest.so] Error 1
> (I guess 3 lines are not worth a pastebin)
>
> I'm working on Windows 8.1 with Android Studio 1.1. I've compiled the
> libraries under Linux Mint 16, a up-to-date ubuntu system and an old debian
> server.
> I build zeromq3-x and zeromq4-x.
>
> Any idea is welcome and appreciated.
>
> If this is not the right place to ask such a question, please tell me
> where to ask it instead.
>
> With regards,
> Matthias
>
>
> _______________________________________________
> 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/20150306/1daf5d92/attachment.htm>


More information about the zeromq-dev mailing list