简体   繁体   English

Linux上适用于Android的Poco C ++

[英]Poco C++ for Android on Linux

I have a project in Qt framework where I would like to use Poco C++ HTML server implementation. 我在Qt框架中有一个项目,我想在其中使用Poco C ++ HTML服务器实现。 I have the code in place and able to compile and run it for Linux desktop, where it works as I would expect. 我已经准备好了代码,并且能够在Linux桌面上编译和运行它,并且可以在我期望的地方工作。 I would like to compile it for Android as well, but here my problem begins. 我也想为Android编译它,但是这里的问题开始了。 I have done the following to get it to work for Android: As the project in Qt is compiled for arm (GCC 4.8) I have created a toolchain for compilation of Poco: 我做了以下工作才能使其在Android上正常工作:由于Qt中的项目是为arm(GCC 4.8)编译的,我创建了一个用于Poco编译的工具链:
<NDK-R9 dir>/build/tools/make-standalone-toolchain.sh --platform=android-9 --install-dir=$HOME/my-android-toolchain --toolchain=arm-linux-androideabi-4.8

Ran configure, make and make install. 运行配置,进行安装。 I have set up the LD_LIBRARY_PATH and would now expect Poco to be ready to use in my Qt project. 我已经设置了LD_LIBRARY_PATH,现在希望Poco可以在我的Qt项目中使用。 When I compile my Qt project I get the following warnings/errors: 编译Qt项目时,出现以下警告/错误:
"skipping incompatible libPocoFoundation.so while searching for PocoFoundation" “搜索PocoFoundation时跳过不兼容的libPocoFoundation.so”
"error: cannot find -lPocoFoundation" “错误:找不到-lPocoFoundation”
So I guess I have not compiled the Poco library as I should in order to use it in Qt. 因此,我想我没有像在Qt中使用Poco库那样编译Poco库。 However, I am lost how to proceed from here. 但是,我不知道如何从这里开始。
Can anyone tell me what I'm doing wrong??? 谁能告诉我我在做什么错???

Regards, 问候,

The problem is that I compiled Poco for both Linux and Android. 问题是我为Linux和Android都编译了Poco。 Firstly, I compiled for Linux: 首先,我针对Linux进行了编译:

./configure --config=linux --no-tests --no-samples
make -s -j4
sudo make install

I then repeated this for Android: 然后,我在Android上重复此操作:

./configure --config=android --no-tests --no-samples --prefix=/usr/local/android
make -s -j4
sudo make install

As I hadn't done a make clean after for the Linux config, the make install for Android config found (and copied) the compiled libs and both Linux and Android. 由于我尚未对Linux配置进行清理,因此发现并复制了Android配置的make install(并复制了)已编译的库以及Linux和Android。

Unfortunately Qt then linked to the wrong libs, which explains the error message I got. 不幸的是Qt然后链接到错误的库,这解释了我得到的错误消息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM