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

前端 未结 5 800
终归单人心
终归单人心 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:25

    As others had mentioned,

    LOCAL_ALLOW_UNDEFINED_SYMBOLS := true

    will not work at run time. Have a look at this:

    https://github.com/MysticTreeGames/Boost-for-Android

    I ran into the same problem with boost (I use a custom 1.42 version).

    Using the brute force method to configure gnustdc++ fixed my issue. The important thing is to link against -lgnustl_static (or whatever stl lib you use) after your libraries.

提交回复
热议问题