androidandroid-ndkgliblibnice

Linker error Android - ndk :undefined reference to `G_STATIC_ASSERT'


I am Building android project for arm64-v8 and I am using NDK-r10e.I have build build Libnice 0.13 using its dependency (Glib 2.35.8) and I have all the dependencies of Glib compiled(intl,iconv,ffi). So I was successfull in building the static libraries of Glib and then using my glib libraries to build a Libnice static library . Now I am using these static libraries to build my android project ,I am getting the following errors and i have no clue why its giving me this linker errors because at the time of building those libraries everything was fine for me.

libnice.a(pseudotcp.o): In function `pseudo_tcp_socket_get_type':
/Users/aagman/Desktop/LibNIce/libnic/Newlibnice/jni/files/agent/pseudotcp.c:78:  undefined reference to `G_STATIC_ASSERT'

In function `nice_agent_get_type':
/Users/aagman/Desktop/LibNIce/libnic/Newlibnice/jni/files/agent/agent.c:85:      undefined reference to `G_STATIC_ASSERT'
/Users/aagman/Desktop/LibNIce/libnic/Newlibnice/jni/files/agent/agent.c:85:  undefined reference to `G_STATIC_ASSERT'

Solution

  • This error occur if the address of an "unsigned int" is passed for a 64 bit build, which would be okay for a 32 bit build but should be an unsigned long for 64 bit. Pass -m64 / -m32 on the command line to control the build target.