【发布时间】:2020-02-29 12:32:28
【问题描述】:
无法使用 Delphi 10.3.3 为 Android 64 位编译我的应用程序。 我的应用程序正在使用 Box2D 库。 编译时出现以下错误:
[DCC Error] E2597 C:\Users\Public\Documents\Embarcadero\Studio\android-ndk-r17b\toolchains\aarch64-linux-android-4.9\prebuilt\windows\aarch64-linux-android\bin\ld.exe: cannot find -lFlatBox2D
C:\Users\Public\Documents\Embarcadero\Studio\android-ndk-r17b\toolchains\aarch64-linux-android-4.9\prebuilt\windows\aarch64-linux-android\bin\ld.exe: cannot find -lgnustl_static
同一应用程序的Android 32位编译成功。 为 Android 64 位编译另一个我的(简单)应用程序可以正常工作。
所以,我意识到,这个问题只存在于我的应用中使用的适用于 Android 64 位的 Box2D。
然后我还测试了 RAD 随附的 Box2D TestBed App 的编译(此处为 ...\Embarcadero\Studio\20.0\Samples\Object Pascal\Multi-Device Samples\Physics\TestBed\) - 同样的问题 - 它已成功编译为 Android 32 位,但当我为 Android 64 编译 TestBed 时出现同样的错误-比特!
请帮忙。我的应用程序中已经有数千行代码,现在完全停止 - 无法为 Android 64 位构建它[scared]
更新1
第二个错误“找不到-lgnustl_static”通过将路径C:\Users\Public\Documents\Embarcadero\Studio\android-ndk-r17b\sources\cxx-stl\gnu-libstdc++\4.9\libs\arm64-v8a添加到菜单工具->选项,然后'SDK Manager'->NDK->'Android SDK 25.2.5 64-bits'->值'修复Delphi NDK 库路径”。
但是,第一个问题'cannot find -lFlatBox2D'仍然存在。
我在我的电脑上只找到了2个库libFlatBox2D.a的文件,它是
C:\Program Files (x86)\Embarcadero\Studio\20.0\lib\android\debug
C:\Program Files (x86)\Embarcadero\Studio\20.0\lib\android\release
我在 SDK Manager for Android 64bit 中添加到同一个“Delphi NDK 库路径”的两个路径。
但是,现在每个路径都会收到错误消息 skipping incompatible libFlatBox2D.a when searching for -lFlatBox2D。
那么现在的问题是——在哪里可以找到兼容的 libFlatBox2D.a,它需要 Android 64 位?
更新 2:
嗯...并且在以下 2 个android64 路径中没有任何 libFlatBox2D.a 文件。
C:\Program Files (x86)\Embarcadero\Studio\20.0\lib\android64\debug
C:\Program Files (x86)\Embarcadero\Studio\20.0\lib\android64\release
这是否意味着 10.3.3 Delphi 安装缺少 64 位 Box2D android 库?
更新3:
正如@Stefanos 所回答的,现在我有 64 位版本的 libFlatBox2D.a。 但是现在在编译时,我收到了 1700 个关于 Box2D 名称的链接器错误,所有这些都类似于以下内容:
[DCC Error] E2597 C:\Users\Public\Documents\Embarcadero\Studio\20.0\Samples\Object Pascal\Multi-Device Samples\Physics\TestBed\Android64\Debug\Box2D.Common.o: In function `Box2d::Common::Create_b2Draw_delegate(System::DelphiInterface<Box2d::Common::Ib2Draw>)':
Box2D.Common:(.text._ZN5Box2d6Common22Create_b2Draw_delegateEN6System15DelphiInterfaceINS0_7Ib2DrawEEE[_ZN5Box2d6Common22Create_b2Draw_delegateEN6System15DelphiInterfaceINS0_7Ib2DrawEEE]+0x0): undefined reference to `Create_b2Draw_delegate'
C:\Users\Public\Documents\Embarcadero\Studio\20.0\Samples\Object Pascal\Multi-Device Samples\Physics\TestBed\Android64\Debug\Box2D.Common.o: In function `Box2d::Common::Destroy_b2Draw_delegate(NativeUInt)':
Box2D.Common:(.text._ZN5Box2d6Common23Destroy_b2Draw_delegateE10NativeUInt[_ZN5Box2d6Common23Destroy_b2Draw_delegateE10NativeUInt]+0x0): undefined reference to `Destroy_b2Draw_delegate'
C:\Users\Public\Documents\Embarcadero\Studio\20.0\Samples\Object Pascal\Multi-Device Samples\Physics\TestBed\Android64\Debug\Box2D.Common.o: In function `Box2d::Common::b2Version_Create()':
Box2D.Common:(.text._ZN5Box2d6Common16b2Version_CreateEv[_ZN5Box2d6Common16b2Version_CreateEv]+0x0): undefined reference to `b2Version_b2Version'
C:\Users\Public\Documents\Embarcadero\Studio\20.0\Samples\Object Pascal\Multi-Device Samples\Physics\TestBed\Android64\Debug\Box2D.Common.o: In function `Box2d::Common::b2BlockAllocator_Create()':
Box2D.Common:(.text._ZN5Box2d6Common23b2BlockAllocator_CreateEv[_ZN5Box2d6Common23b2BlockAllocator_CreateEv]+0x0): undefined reference to `b2BlockAllocator_b2BlockAllocator_1'
C:\Users\Public\Documents\Embarcadero\Studio\20.0\Samples\Object Pascal\Multi-Device Samples\Physics\TestBed\Android64\Debug\Box2D.Common.o: In function `Box2d::Common::b2BlockAllocator_Destroy(NativeUInt)':
Box2D.Common:(.text._ZN5Box2d6Common24b2BlockAllocator_DestroyE10NativeUInt[_ZN5Box2d6Common24b2BlockAllocator_DestroyE10NativeUInt]+0x0): undefined reference to `b2BlockAllocator_dtor'
etc...etc...
UPDATE4:当前状态
我现在正在寻找 Android 64 位 (Delphi 10.3.3) 的原始 libFlatBox2D.a 库文件。如果有人有,请与我分享。
以上尝试均未成功。需要一个“原始”64 位 libFlatBox2D.a,它不在我的 RAD 10.3.3 安装中...
更新5:
Embarcadero QA 创建了一个工单: https://quality.embarcadero.com/browse/RSP-27762 将等待他们的解决方案。
【问题讨论】:
-
@LURD 谢谢你的建议。现在已经修复了两个错误之一。但是,对于 Android 64 位编译,libFlatBox2D.a 仍然存在问题 - 请参阅上面的更新。谁知道如何解决这个问题?在哪里可以找到兼容的 libFlatBox2D.a?
-
您是否将“FlatBox2D”(即 libFlatBox2D.a)添加到“附加链接库”项目链接器选项中?在这里找到参考:github.com/FMXExpress/Firemonkey/blob/master/Embarcadero/XE8/…
-
这是 QP 报告。密切关注它 - 我们将看看我们是否可以在错误报告中发布二进制文件。 quality.embarcadero.com/browse/RSP-27762 10.4 应该正常使用。
标签: android delphi compilation 64-bit box2d