apolukhin / Boost.DLL

Library for comfortable work with DLL and DSO
https://boost.org/libs/dll
109 stars 69 forks source link

Getting error text upon loading ? #38

Closed jcelerier closed 5 years ago

jcelerier commented 6 years ago

Qt's QPluginLoader has a way to get an error string about what happened when a plug-in could not be loaded: http://doc.qt.io/qt-5/qpluginloader.html#errorString

Is there a way to get the same with Boost.DLL ? it makes debugging for missing export symbols much easier.

apolukhin commented 6 years ago

If the loading fails, an exception is thrown with a message that describes the error in details https://github.com/apolukhin/Boost.DLL/blob/develop/include/boost/dll/detail/system_error.hpp#L35

Note that overloads that take error_code& pearameter do not report error text. Only the throwing versions have that feature https://github.com/apolukhin/Boost.DLL/blob/develop/include/boost/dll/shared_library.hpp#L250