ndk-build: undefined reference to .. errors when statically linking to libxml.a

前端 未结 5 792
终归单人心
终归单人心 2021-02-08 04:34

I get a lot of undefined reference to ... errors when I compile my single c++ source-file using the ndk-build tool. For the record I use NDK r6 on a linux host system.

F

5条回答
  •  情书的邮戳
    2021-02-08 05:24

    Add the line

    LOCAL_ALLOW_UNDEFINED_SYMBOLS := true
    

    to the Android.mk file and it should work. As explained in the ndk doc, it is because the ndk performs a debug checking even for avoiding runtime linking error and for some motivations it doesn't find the correct references in a pre-built library. Hope it coulds help.

提交回复
热议问题