[zeromq-dev] ZeroMQ for Android: Problem in building the Android APK

Sharon Ben-Asher Sharon.Ben-Asher at avg.com
Wed Jul 18 14:53:34 CEST 2012


Hi,

Well, after realizing its an issue with STL, I spent half the day on the net researching Android NDK and C++ STL.
Indeed, the default implementation is "minimal" according to the docs.
The issue is really an issue since we are using the Android NDK as standalone compiler.  As a full build env, you can specify in the Application.mk (their version of makefile) that you want to use STL.  They even support several versions of the library. 
So perhaps someone needs to repackage the whole directory tree into an Android project.  I think I lack the knowledge of how to do it. 

However, I did find that the standalone toolchain does come with gunstl_shared lib.  And I even managed to specify the proper argument to configure and to build new shared object files. 
However, now when I try to run the APK, I get an error about not finding libgnustl_shared.so.  tried to put it together with libjzmq.so, but to no avail.
I am running out of time with this experiment, they want to move to an all-java solution. So if time permits, I will try to build the 2.2 version.

Sharon.

-----Original Message-----
From: Victor Perron <victor at iso3103.net>
Subject: Re: [zeromq-dev] zeromq-dev Digest, Vol 55, Issue 14
To: ZeroMQ development list <zeromq-dev at lists.zeromq.org>
Message-ID:
	<CAF9FejHK-9LOrwhHMrinkeaiq5AkwAcxijVV9K6X45j5d__EaQ at mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hi,

In that case it seems that you discovered something serious.
I took a look at it, and indeed the assign() symbol from std::string class seems undefined.
That would mean, Android does _not_ define such a function in its SDK.

Now, the proper way to get around this is a patch to Zeromq 3.x.
You'll have to fix those lines (my guess):

./src/ipc_listener.cpp:151:    filename.assign(addr_);
./src/socket_base.cpp:331:            options.last_endpoint.assign (addr_);
./src/socket_base.cpp:480:        options.last_endpoint.assign (addr_);
./src/tcp_address.cpp:503:        addr_str.assign (name_, delimiter -
name_);
./src/tcp_address.cpp:504:        mask_str.assign (delimiter + 1);
./src/tcp_address.cpp:511:        addr_str.assign (name_);

... and try to compile again. If there are no other undefined symbols, that should work.
That issue did not exist in ZeroMQ 2.2 though, that one didn't make an extensive use of std::string.

Keep me updated, we'll see for a pull request when I'll be less busy ;)

Best regards,




More information about the zeromq-dev mailing list