D on android and d_android

burt invalid_email_address at cab.abc
Wed Apr 1 14:54:35 UTC 2020


On Wednesday, 1 April 2020 at 14:31:45 UTC, Adam D. Ruppe wrote:
> On Wednesday, 1 April 2020 at 14:20:25 UTC, burt wrote:
>> Some examples of errors are:
>
> Those mean it isn't linking in the libs at all... ugh.
>
> do
>
> ldc2 -v
>
> and it will tell you where the config file is.
>
> open that up and see if it has teh correct paths under a 
> section that looks kinda like
>
> "armv7a-.*-linux-android":
> {
>     switches = [
>         "-defaultlib=phobos2-ldc,druntime-ldc",
>         "-link-defaultlib-shared=false",
>         
> "-gcc=$NDK/toolchains/llvm/prebuilt/$OS/bin/armv7a-linux-androideabi21-clang$EXT",
>         "-linker=bfd",
>         "-mcpu=cortex-a8",
>     ];
>     lib-dirs = [
>         "$D_ANDROID/runtime_droid_armeabi-v7a",
>     ];
>
> That lib-dirs one in particular is what I'm interested in.

It gives me lib-dirs = [ 
"C:/Users/<myname>/Programs/runtime_droid_armeabi-v7a", ];

At that location this folder is located and the contents are 
libdruntime-ldc.a, libdruntime-ldc-debug.a, libphobos2-ldc.a and 
libphobos2-ldc-debug.a. Sizes are 2511 kB, 4792 kB, 10.010 kB and 
17.378 kB respectively.

During another attempt I copied those folder to my dub project 
and included the path to those folders in my dub.json as 
"lflags": ["--library-path=./runtime_droid_armeabi-v7a"]. This 
gave me exactly the same errors.

Other ldc2.conf contents for that section was as follows:
switches = [
         "-defaultlib=phobos2-ldc,druntime-ldc",
         "-link-defaultlib-shared=false",
         
"-gcc=C:/Users/<user>/AppData/Local/Android/Sdk/ndk/21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64/bin/armv7a-linux-androideabi21-clang.cmd",
         "-linker=bfd",
         "-mcpu=cortex-a8",
     ];





More information about the Digitalmars-d-learn mailing list