Fix building errors on x86_64-w64-mingw32 due to wrong linking order.
Merge pull request #234 from hauzer/master

Building of example fails on x86_64-w64-mingw32 with unresolved references due to wrong linking order
Add FromPrimitive to a few enums, to allow casting from primitive types.
Merge pull request #235 from nstoddard/master

Add FromPrimitive to a few enums, to allow casting from primitive types.