To enable this to be built under gcc, system libraries must be put last in the link command. Currently, it will result in undefined references.