Search code examples
android-ndkshared-librariesstatic-linkingdynamic-linking

NDK - How to get "undefined reference" during compile-time?


I am using the standalone toolchain to produce my .so and when I link my .o files to it, I get no "undefined reference" errors because it is creating dependencies that are resolved during runtime.

I would like to resolve all the symbols during the compile-time and get "undefined reference" when symbols aren't resolved. How do I do that?


Solution

  • "-z defs" does the job.

    Ref.: http://linux.die.net/man/1/ld