• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

【Delphi】RAD10.4开发Android时如何在迁移SDK和NDK路径后解决提示ld:cannotfind-lxxx ...

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

今天使用lite版本安装了RAD Delphi10.4,发现自动把Android的SDK和NDK目录安装到C盘下,由于C盘容量紧张,所以想把目录迁移到其他路径!

在之前的版本是直接移动目录,在到delphi的tools-options菜单页面中修改SDK路径即可。

但是这次修改后发现在link时仍然找不到路径,查看了delphi的编译命令行信息,发现其中 usr\lib 路径仍然是C盘的,如下:

dccaarm command line for "Project1.dpr"
  f:\program_files\embarcadero\studio\21.0\bin\dccaarm.exe -$O- --no-config -B -Q -TX.so -AGenerics.Collections=System.Generics.Collections;
  Generics.Defaults=System.Generics.Defaults -DDEBUG -E.\Android\Debug -If:\program_files\embarcadero\studio\21.0\lib\Android\debug;
  f:\program_files\embarcadero\studio\21.0\lib\Android\Release -LEC:\Users\Public\Documents\Embarcadero\Studio\21.0\Bpl\Android 
  -LNC:\Users\Public\Documents\Embarcadero\Studio\21.0\Dcp\Android -NU.\Android\Debug -NSSystem;Xml;Data;Datasnap;Web;Soap; 
  -Of:\program_files\embarcadero\studio\21.0\lib\Android\Release -Rf:\program_files\embarcadero\studio\21.0\lib\Android\Release 
  -Uf:\program_files\embarcadero\studio\21.0\lib\Android\debug;f:\program_files\embarcadero\studio\21.0\lib\Android\Release 
  --libpath:C:\Users\Public\Documents\Embarcadero\Studio\21.0\PlatformSDKs\android-ndk-r21\sources\cxx-stl\llvm-libc++\libs\armeabi-v7a;
  C:\Users\Public\Documents\Embarcadero\Studio\21.0\PlatformSDKs\android-ndk-r21\platforms\android-23\arch-arm\usr\lib 
  --linker:F:\Program_Files\Embarcadero\Studio\21.0\PlatformSDKs\android-ndk-r21\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64\bin\arm-linux-androideabi-ld.exe 
  -V -VN -NO.\Android\Debug  Project1.dpr   

再次检查sdk路径,发现并无错误,猜测可能是delphi的bug,估计是漏掉了NDK library Path,页面中仅有C++ Builder的NDK library Path设置项(难道是lite版本裁剪后导致的?)。

好在发现delphi提供了设置项的export和import功能,因此,我先使用export导出设置文件,内容如下:

<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="">
  <PropertyGroup>
    <Profile_platform>Android64</Profile_platform>
    <Profile_host>localhost</Profile_host>
    <Profile_port>64211</Profile_port>
    <Profile_sdkname>AndroidSDK25.2.5_64bit.sdk</Profile_sdkname>
    <Profile_displayname>Android SDK 25.2.5 64-bit</Profile_displayname>
    <Profile_version>25.2.5</Profile_version>
    <Profile_sysroot>F:\Program_Files\Embarcadero\Studio\21.0\PlatformSDKs\android-sdk-windows</Profile_sysroot>
    <NDKArmLinuxAndroidFile>F:\Program_Files\Embarcadero\Studio\21.0\PlatformSDKs\android-ndk-r21\toolchains\aarch64-linux-android-4.9\prebuilt\windows-x86_64\aarch64-linux-android\bin\ld.exe</NDKArmLinuxAndroidFile>
    <NDKArmLinuxAndroidStripFile>F:\Program_Files\Embarcadero\Studio\21.0\PlatformSDKs\android-ndk-r21\toolchains\aarch64-linux-android-4.9\prebuilt\windows-x86_64\aarch64-linux-android\bin\strip.exe</NDKArmLinuxAndroidStripFile>
    <NDKApiPath>F:\Program_Files\Embarcadero\Studio\21.0\PlatformSDKs\android-ndk-r21\platforms\android-23</NDKApiPath>
    <NDKBasePath>F:\Program_Files\Embarcadero\Studio\21.0\PlatformSDKs\android-ndk-r21</NDKBasePath>
    <NDKGdbServerPath>F:\Program_Files\Embarcadero\Studio\21.0\PlatformSDKs\android-ndk-r21\prebuilt\android-arm64\gdbserver\gdbserver</NDKGdbServerPath>
    <SDKZipAlignPath>F:\Program_Files\Embarcadero\Studio\21.0\PlatformSDKs\android-sdk-windows\build-tools\29.0.3\ZipAlign.exe</SDKZipAlignPath>
    <SDKAndroidPath>F:\Program_Files\Embarcadero\Studio\21.0\PlatformSDKs\android-sdk-windows\tools\Android.bat</SDKAndroidPath>
    <SDKAdbPath>F:\Program_Files\Embarcadero\Studio\21.0\PlatformSDKs\android-sdk-windows\platform-tools\Adb.exe</SDKAdbPath>
    <SDKAaptPath>F:\Program_Files\Embarcadero\Studio\21.0\PlatformSDKs\android-sdk-windows\build-tools\29.0.3\Aapt.exe</SDKAaptPath>
    <SDKApiLevelPath>F:\Program_Files\Embarcadero\Studio\21.0\PlatformSDKs\android-sdk-windows\platforms\android-29\android.jar</SDKApiLevelPath>
    <JDKPath>C:\Program Files (x86)\Java\jdk1.8.0_112</JDKPath>
    <JDKJarsignerPath>C:\Program Files (x86)\Java\jdk1.8.0_112\bin\JarSigner.exe</JDKJarsignerPath>
    <JDKKeyToolPath>C:\Program Files (x86)\Java\jdk1.8.0_112\bin\KeyTool.exe</JDKKeyToolPath>
    <DelphiNDKLibraryPath>C:\Users\Public\Documents\Embarcadero\Studio\21.0\PlatformSDKs\android-ndk-r21\sources\cxx-stl\llvm-libc++\libs\arm64-v8a;C:\Users\Public\Documents\Embarcadero\Studio\21.0\PlatformSDKs\android-ndk-r21\platforms\android-23\arch-arm64\usr\lib</DelphiNDKLibraryPath>
    <CBuilderNDKLibraryPath>F:\Program_Files\Embarcadero\Studio\21.0\PlatformSDKs\android-ndk-r21\platforms\android-23\arch-arm64\usr\lib</CBuilderNDKLibraryPath>
    <Profile_password>xxxxxxxx</Profile_password>
  </PropertyGroup>
</Project>

注意其中的<DelphiNDKLibraryPath>仍然指向未迁移前的C盘路径,因此将该路径修改后,再重新使用import功能导入设置即可。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
【 MATLAB 】使用案例研究 DTFT 的对称性发布时间:2022-07-18
下一篇:
MATLAB-R2015b-win64安装详细教程发布时间:2022-07-18
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap