My Qt app uses QLibrary to access a function in a DLL (actually .dylib). The program works fine on Windows and Linux, but I'm having trouble loading the DLL on Mac OSX.

QLibrary myLib(dll_path);

fails to load the DLL. Apparently it can't find it, although I can't be totally sure, since

errStr = myLib.errorString();

returns "Unknown error"

In any case I don't know where the app looks to find the DLL. I started by putting it in /usr/local/lib, Unix-style. I then put it in the same directory as the executable, then I tried putting it in the package, in Contents/Plugins, and adding this to main.cpp

app.addLibraryPath(app.applicationDirPath() + "/../Plugins");

but the load always fails. Can someone help?