Change _MSC_VER to _WIN32. Added '-ldl' linker flag. Other cosmotics