Porting the libcoind static linking fix to the other applications/examples/tests.