Fixed the ordering issue when linking

g++ requires the static libraries to be linked in a particular order. If
A depends on B, A should be ahead of B.
Fixed a warning on an unused return value