JackWeakAPI: tryload_libjack sends "Failed to load libjack DLL: -1644446336libjack not found, so do not try to load jack_client_open ffs !" to stderr unconditionally
Describe the bug
The https://github.com/jackaudio/jack2/blob/master/common/JackWeakAPI.c does not behave weak. The tryload_libjack sends "Failed to load libjack DLL: -1644446336libjack not found, so do not try to load jack_client_open ffs !" to stderr if libjack is ot installed on the system. JACK is an optional feature in our application and we use the JackWeakAPI to probe if the user has JACK installed. We get many bug reports because of this error message in on the console.
Environment
-
JACK Version: Which version of jack2 are you using? 1.9.22
-
Operating System: What operating system or distribution in which version are you using? (e.g. Linux, macOS, Windows) We use the VCPKG port on Windows
Steps To Reproduce
Execute tryload_libjack() in a minimal program, on a Windows system without libjack.dll/libjack64.dll installed.
Expected vs. actual behavior
1.) https://github.com/jackaudio/jack2/blob/4f58969432339a250ce87fe855fb962c67d00ddb/common/JackWeakAPI.c#L71 is not working as intended. It should gather the detailed error text from Windows, but it prints a random number like -1644446336. 2.) The weak API should probe for the libjack installation silent. Either make the printout to stderr optional by a flag, or store the message in a string, which the application code can evaluate or not.