#ifdef WIN32 #include #include #include #elif !defined(macintosh) #include #include #endif #include #include #include using namespace osg; using namespace osgDB; DynamicLibrary::DynamicLibrary(const std::string& name,HANDLE handle) { _name = name; _handle = handle; } DynamicLibrary::~DynamicLibrary() { if (_handle) { #ifdef WIN32 FreeLibrary((HMODULE)_handle); #elif !defined(macintosh) dlclose(_handle); #endif } } DynamicLibrary* DynamicLibrary::loadLibrary(const std::string& libraryName) { char* fullLibraryName = osgDB::findDSO( libraryName.c_str() ); if (fullLibraryName==NULL) return NULL; #ifdef WIN32 HANDLE handle = LoadLibrary( fullLibraryName ); if (handle) return new DynamicLibrary(libraryName,handle); notify(WARN) << "DynamicLibrary::failed loading "<