diff options
author | lloyd <[email protected]> | 2010-07-30 16:08:09 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-07-30 16:08:09 +0000 |
commit | 28cbb01e766ed8aab988f6e3a4fd49e21a7aa258 (patch) | |
tree | 908816d9da59306431d20e2ec89ffa0806ebcc9b /src/utils/dyn_load | |
parent | 58be96ef4a9f3e88f077d4d44748ea167284247b (diff) |
If dynamic loading fails, include result of dlerror() in the exception msg
Diffstat (limited to 'src/utils/dyn_load')
-rw-r--r-- | src/utils/dyn_load/dyn_load.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/utils/dyn_load/dyn_load.cpp b/src/utils/dyn_load/dyn_load.cpp index 621737d0c..6d359bc01 100644 --- a/src/utils/dyn_load/dyn_load.cpp +++ b/src/utils/dyn_load/dyn_load.cpp @@ -23,7 +23,14 @@ Dynamically_Loaded_Library::Dynamically_Loaded_Library( lib = ::dlopen(lib_name.c_str(), RTLD_LAZY); if(!lib) - throw std::runtime_error("Failed to load engine " + lib_name); + { + const char* dl_err = dlerror(); + if(!dl_err) + dl_err = "Unknown error"; + + throw std::runtime_error("Failed to load engine " + lib_name + ": " + + dl_err); + } #endif } |