Adapted to MSVC specifities.

There must be a better way to get the compilation/linkage done using MSVC but this is the fastest one.