diff --git a/pd/src/s_loader.c b/pd/src/s_loader.c index 1dc0646a809a2d73255dda9a5d51d7d420d1d46c..f656f3ddfc3b2edc8de145822e6d65a58ff69060 100644 --- a/pd/src/s_loader.c +++ b/pd/src/s_loader.c @@ -250,7 +250,14 @@ gotone: ntdll = LoadLibrary(filename); if (!ntdll) { - verbose(1, "%s: couldn't load", filename); + wchar_t wbuf[MAXPDSTRING]; + char buf[MAXPDSTRING]; + DWORD count, err = GetLastError(); + count = FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + 0, err, MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT), wbuf, MAXPDSTRING, NULL); + if (!count || !WideCharToMultiByte(CP_UTF8, 0, wbuf, count+1, buf, MAXPDSTRING, 0, 0)) + *buf = '\0'; + error("%s: %s (%d)", filename, buf, err); class_set_extern_dir(&s_); return (0); } @@ -263,7 +270,7 @@ gotone: dlobj = dlopen(filename, RTLD_NOW | RTLD_GLOBAL); if (!dlobj) { - verbose(1, "%s: %s", filename, dlerror()); + error("%s: %s", filename, dlerror()); class_set_extern_dir(&s_); return (0); } @@ -277,7 +284,7 @@ gotone: if (!makeout) { - verbose(1, "load_object: Symbol \"%s\" not found", symname); + error("load_object: Symbol \"%s\" not found", symname); class_set_extern_dir(&s_); return 0; }