如何使用 Android NDK 构建 Platinum UPnP 堆栈?

发布于 2024-10-06 14:27:26 字数 1582 浏览 5 评论 0原文

我在 MacOSX 10.6.5 上使用 Android NDK 构建 Platinum UPnP 堆栈时遇到问题。

我已从

然后我将 ANDROID_NDK_HOME 设置到我的 NDK 根目录并尝试构建:
scons -Q target=arm-android-linux 我收到以下错误:

(...) 例外:ANDROID NDK 未配置,请使用 host-setup.sh 进行配置: (...)

问题是根据文档,该文件已从 Android NDK 中删除:

以前的版本要求您运行“build/host-setup.sh”脚本 配置 NDK。不过,此步骤已在版本 4 中删除。

现在我有点卡住了,不知道如何解决这个问题。

更新:

我已经下载了 NDK r3(最后一个缺少文件的版本)并使用 host-setup.sh 配置了它,

但是当我尝试构建目标时,它运行了一段时间然后崩溃:

Build/Targets/arm-android-linux/Debug/Source/Tests/FileMediaServer/FileMediaServerTest.o: In function `main':
/Users/darkh/Platinum-SRC-0-6-3_683/Platinum/Source/Tests/FileMediaServer/FileMediaServerTest.cpp:153: warning: warning: gets() is very unsafe; consider using fgets()

Build/Targets/arm-android-linux/Debug/libPltMediaServer.a(PltMediaItem.o): In function `PLT_MediaItem::DynamicCast(void const*)':
PltMediaItem.cpp:(.text._ZN13PLT_MediaItem11DynamicCastEPKv[PLT_MediaItem::DynamicCast(void const*)]+0x5c): undefined reference to `PLT_MediaItem::_class_PLT_MediaItem'

Build/Targets/arm-android-linux/Debug/libPltMediaServer.a(PltMediaItem.o): In function `PLT_MediaContainer::DynamicCast(void const*)':
PltMediaItem.cpp:(.text._ZN18PLT_MediaContainer11DynamicCastEPKv[PLT_MediaContainer::DynamicCast(void const*)]+0x5c): undefined reference to `PLT_MediaContainer::_class_PLT_MediaContainer'
collect2: ld returned 1 exit status

scons: *** [Build/Targets/arm-android-linux/Debug/FileMediaServerTest] Error 1

I have a problem with building the Platinum UPnP stack with Android NDK on MacOSX 10.6.5.

I've downloaded the latest version of Android NDK for Mac from here, installed SCons (for building) and downloaded the latest version of Platinum form their website.

Than I setup the ANDROID_NDK_HOME to my NDK root directory and tried to build:
scons -Q target=arm-android-linux and I got the following error:

(...)
Exception: ANDROID NDK not configured, use host-setup.sh to configure it:
(...)

The problem is that this file got removed from the Android NDK according to the documentation:

Previous releases required you to run the 'build/host-setup.sh' script to
configure the NDK. However, this step has been removed in release 4.

And now I'm kinda stuck and don't know how to solve this issue.

UPDATE:

I've downloaded the NDK r3 (the last one with the missing file) and configured it with host-setup.sh

But when I try to build the target, it runs for some time and then crashes on:

Build/Targets/arm-android-linux/Debug/Source/Tests/FileMediaServer/FileMediaServerTest.o: In function `main':
/Users/darkh/Platinum-SRC-0-6-3_683/Platinum/Source/Tests/FileMediaServer/FileMediaServerTest.cpp:153: warning: warning: gets() is very unsafe; consider using fgets()

Build/Targets/arm-android-linux/Debug/libPltMediaServer.a(PltMediaItem.o): In function `PLT_MediaItem::DynamicCast(void const*)':
PltMediaItem.cpp:(.text._ZN13PLT_MediaItem11DynamicCastEPKv[PLT_MediaItem::DynamicCast(void const*)]+0x5c): undefined reference to `PLT_MediaItem::_class_PLT_MediaItem'

Build/Targets/arm-android-linux/Debug/libPltMediaServer.a(PltMediaItem.o): In function `PLT_MediaContainer::DynamicCast(void const*)':
PltMediaItem.cpp:(.text._ZN18PLT_MediaContainer11DynamicCastEPKv[PLT_MediaContainer::DynamicCast(void const*)]+0x5c): undefined reference to `PLT_MediaContainer::_class_PLT_MediaContainer'
collect2: ld returned 1 exit status

scons: *** [Build/Targets/arm-android-linux/Debug/FileMediaServerTest] Error 1

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

痴情换悲伤 2024-10-13 14:27:26

除了host-setup.sh问题之外,Platinum似乎使用自己的基于SCons的构建系统,该系统依赖于包含arm-eabi-4.4.0的编译器的路径。这在最新的 Android NDK 中也发生了变化。

您要么必须自己破解构建系统,要么等待他们更新 r5。一个好的开始查找的地方是文件 Build/Targets/arm-android-linux/Config.scons,但是您必须进行一些不明显的更改才能获得它启动并运行。

编辑:

尝试使用 r4b。在 android-ndk-r4b/out/host/config.mk 中创建一个文件,其内容为:

HOST_TAG := linux-x86

.. 或 Mac 上的等效文件 - 无论 android-ndk-r4b/build 中的目录是什么/prebuilt/ 被调用。那应该编译很多东西 - 它在这里完成了。

Apart from the host-setup.sh issue, it looks like Platinum uses its own SCons based build system that relies on the path of the compiler containing arm-eabi-4.4.0. That has changed in the latest Android NDK too.

You'll either have to hack the build system yourself or wait for them to update it for r5. A good place to start looking would be the file Build/Targets/arm-android-linux/Config.scons, but there are quite a few non-obvious changes you'd have to make to get it up and running.

EDIT:

Try with r4b. Create a file in android-ndk-r4b/out/host/config.mk whose contents is:

HOST_TAG := linux-x86

.. or the equivalent on Mac - whatever the directory in android-ndk-r4b/build/prebuilt/ is called. That should compile the lot - it did here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文