I was using libtool to load a library which has unsatisfied dependencies. libtool tells me that "file not found" while dlopen gives the correct message "undefined symbol".
This is because the last error was overridden by the subsequent tries. Maybe we should stop trying once the right file was found. This way the right message could be given to user.