ugly hack for cross platform dynamic library loading