aboutsummaryrefslogtreecommitdiff
path: root/lib/System/DynamicLibrary.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/System/DynamicLibrary.cpp')
-rw-r--r--lib/System/DynamicLibrary.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/System/DynamicLibrary.cpp b/lib/System/DynamicLibrary.cpp
index ca7bee661a..477e3051c0 100644
--- a/lib/System/DynamicLibrary.cpp
+++ b/lib/System/DynamicLibrary.cpp
@@ -28,6 +28,16 @@ using namespace sys;
#ifdef HAVE_LT_DLOPEN
+DynamicLibrary::DynamicLibrary() : handle(0) {
+ if (0 != lt_dlinit())
+ throw std::string(lt_dlerror());
+
+ handle = lt_dlopen(0);
+
+ if (handle == 0)
+ throw std::string("Can't open program as dynamic library");
+}
+
DynamicLibrary::DynamicLibrary(const char*filename) : handle(0) {
if (0 != lt_dlinit())
throw std::string(lt_dlerror());