diff --git a/hcore/senseApis/senseApiManager.cpp b/hcore/senseApis/senseApiManager.cpp index 061577b..6585842 100644 --- a/hcore/senseApis/senseApiManager.cpp +++ b/hcore/senseApis/senseApiManager.cpp @@ -65,11 +65,13 @@ SenseApiLib& SenseApiManager::loadSenseApiLib(const std::string& libraryPath) if (!lib->handle) { - std::string error = dlerror() - ? dlerror() - : "Unknown error while opening shlib"; + const char *dlerr = dlerror(); + + std::string error = (dlerr + ? dlerr + : "Unknown error while opening shlib"); throw std::runtime_error( - std::string(__func__) + " - Cannot load library '" + std::string(__func__) + ": Cannot load library '" + libraryPath + "': " + error); }