1

我在 Qt 框架中有一个项目,我想在其中使用 Poco C++ HTML 服务器实现。我已经准备好代码,并且能够为 Linux 桌面编译和运行它,它可以像我预期的那样工作。我也想为 Android 编译它,但我的问题从这里开始。我已经完成了以下操作以使其适用于 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 和 make install。我已经设置了 LD_LIBRARY_PATH,现在希望 Poco 可以在我的 Qt 项目中使用。当我编译我的 Qt 项目时,我收到以下警告/错误:
“在搜索 PocoFoundation 时跳过不兼容的 libPocoFoundation.so”
“错误:找不到 -lPocoFoundation”
所以我想我没有编译 Poco 库,以便在 Qt 中使用它。但是,我迷失了如何从这里开始。
谁能告诉我我做错了什么???

问候,

4

1 回答 1

0

问题是我为 Linux 和 Android 编译了 Poco。首先,我为 Linux 编译:

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

然后我为Android重复了这个:

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

由于我没有对 Linux 配置进行 make clean,因此 Android 配置的 make install 找到(并复制了)已编译的库以及 Linux 和 Android。

不幸的是,Qt 然后链接到了错误的库,这解释了我收到的错误消息。

于 2013-11-13T09:19:16.893 回答