Commit a3b1009a authored by Mark Friedrichs's avatar Mark Friedrichs
Browse files

Modified OpenMMSerialization lib names for different OSs

parent b2c28984
...@@ -93,8 +93,8 @@ extern "C" void registerAmoebaSerializationProxies() { ...@@ -93,8 +93,8 @@ extern "C" void registerAmoebaSerializationProxies() {
// is there a cleaner solution? // is there a cleaner solution?
std::string file = "libOpenMMSerialization.so";
#ifdef WIN32 #ifdef WIN32
std::string file = "OpenMMSerialization.dll";
// Tell Windows not to bother the user with ugly error boxes. // Tell Windows not to bother the user with ugly error boxes.
const UINT oldErrorMode = SetErrorMode(SEM_FAILCRITICALERRORS); const UINT oldErrorMode = SetErrorMode(SEM_FAILCRITICALERRORS);
HMODULE handle = LoadLibrary(file.c_str()); HMODULE handle = LoadLibrary(file.c_str());
...@@ -105,9 +105,16 @@ extern "C" void registerAmoebaSerializationProxies() { ...@@ -105,9 +105,16 @@ extern "C" void registerAmoebaSerializationProxies() {
throw OpenMMException(message); throw OpenMMException(message);
} }
#else #else
std::string fileName = "OpenMMSerialization";
std::string file = "libOpenMMSerialization.so";
std::string macFile = "libOpenMMSerialization.dylib";
void *handle = dlopen(file.c_str(), RTLD_LAZY | RTLD_GLOBAL); void *handle = dlopen(file.c_str(), RTLD_LAZY | RTLD_GLOBAL);
if (handle == NULL) if (handle == NULL){
throw OpenMMException("Error loading library "+file+": "+dlerror()); handle = dlopen(macFile.c_str(), RTLD_LAZY | RTLD_GLOBAL);
if (handle == NULL){
throw OpenMMException("Error loading library "+fileName+": "+dlerror());
}
}
#endif #endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment