fplutil
An open source project by
FPL.
|
By default the linker will not link an application against libfplutil_main
or libfplutil_print
as the application will not typically reference symbols in the libraries. Therefore the linker must be instructed to always link against the libraries. This can be achieved by using:
LOCAL_WHOLE_STATIC_LIBRARIES
when using Android NDK makefiles.--whole-archive
linker flag when directly using the compiler toolchain.For example, a build target in an Android NDK makefile which builds an application that links against both libfplutil_main
and libfplutil_print
may look like this:
LOCAL_WHOLE_STATIC_LIBRARIES
adds --whole-archive
to the linker command line for each of the listed libraries.
When using the Android make system (ndk-build), linking libfplutil_print
will automatically wrap calls to stdio and iostreams. When imported using import-module
, the module exports the appropriate flags for the compiler and linker:
When using the toolchain directly, to link against libfplutil_print
, you must manually wrap the functions it implements manually. To wrap functions, pass the corresponding --wrap=<name>
option on your link line.
For example: