Overview
Features
Download
Documentation
Community
Add-Ons & Services

[Solved] Compile for Android

Please post support and help requests here.

[Solved] Compile for Android

Postby helthans » 05 Nov 2013, 15:28

Hi,

I have a project in Qt framework and I would like to use the Poco library to implement a HTTP server. I have the implementation in place and compiling for Linux desktop everything works as I expect.
I also want to compile it for Android.
I have made a toolchain by running the command:
${NDK-R9-DIR}/build/tools/make-standalone-toolchain.sh --platform=android-9 --install-dir=$HOME/my-android-toochain --toolchain=arm-linux-androideabi-4.8
Then I updated my PATH:
export PATH=$PATH:$HOME/my-android-toolchain/bin
Ran configure, make and make install.
Now I would expect Poco library to be in place to be used in my Qt project, but when I compile in Qt I get the following warnings/errors: "skipping incompatible libPocoFoundation.so while searching for PocoFoundation" and "error: cannot find -lPocoFoundation". So I guess my problem is that Poco has not been compiled with same compiler as my Qt project (which has been compiled with Android for amr (GCC 4.8))
I am kind of stuck regarding how I proceed from here. Any one knows what I'm doing wrong??

Best regards

EDIT: I have also set LIBS += -L/path/to/my/poco/libs -lPocoFoundation, and I can see from the warning message that it looks in the right directory
Last edited by helthans on 13 Nov 2013, 10:11, edited 1 time in total.
helthans
 
Posts: 14
Joined: 05 Nov 2013, 15:07

Re: Compile for Android

Postby helthans » 12 Nov 2013, 11:30

No one???
I have checked that I'm using the correct version of gcc/g++ as well (don't if that matters in this case), so currently I'm totally clueless how to proceed.
I get the following error message:
/home/bob/dev/android-ndk-r9b/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: warning: skipping incompatible /usr/local/android/usr/local/lib/libPocoFoundation.so while searching for PocoFoundation
/home/bob/dev/android-ndk-r9b/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lPocoFoundation
helthans
 
Posts: 14
Joined: 05 Nov 2013, 15:07

Re: Compile for Android

Postby guenter » 13 Nov 2013, 00:35

It's been some time that I've worked with the NDK, but one thing that I find suspect is the error message:
/home/bob/dev/android-ndk-r9b/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: warning: skipping incompatible /usr/local/android/usr/local/lib/libPocoFoundation.so while searching for PocoFoundation


Seems you're mixing toolchains. The error message clearly is from the prebuilt toolchain, while POCO, according to your explanations, has been built with the standalone toolchain.
guenter
 
Posts: 1138
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: [Solved] Compile for Android

Postby helthans » 13 Nov 2013, 11:08

Well. It turns out that the problem was a little different than expected. First I had compiled for linux:
Code: Select all
./configure --config=Linux --no-samples --no-tests
make -s -j4
sudo make install

Then I repeated it for android
Code: Select all
./configure --config=Android --no-samples --no-tests --prefix=/usr/local/android
make -s -j4
sudo make install

As I didn't do a
Code: Select all
make clean

after running the make commands for the Linux configuration, the make install script found (and copied) the compiled libs for both Linux and Android while in the Android configuration.
Unfortunately Qt then linked to the wrong libs, which explains the error message I got.
helthans
 
Posts: 14
Joined: 05 Nov 2013, 15:07


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron