self answer:
When a linux app loads it need to be able to access all the libXXX.so it needs. "ld" will look for them in any directory declared in the "LD_LIBRARY_PATH" variable
However Qt seems to load its plugins dynamically from some paths which can be found there:
@QCoreApplication app(argc,argv);
qDebug() << app.libraryPaths();@
which printed
@("/my/App/Path","/Qt/Dir/Path" )@
And from one of this path it should load the plugins. So if in qtDir you have
@/Qt/Dir/Path/plugins/sqldrivers/libqsqltds.so@
You want to make sure to deploy something like:
@/my/App/Path/sqldrivers/libqsqltds.so@
this worked fine because the app path is always in "app.libraryPaths()". However, where things get complicated it that libqsqltds.so requires "libsybdb.so.5" to work properly. Which I knew so there also was a
@/my/App/Path/sqldrivers/libsybdb.so.5 @
which was wrong because Qt loads dynamically libqsqltds.so but not its dependency, which it seems ld expects to find the usual way ( e.g. in the LD_LIBRARY_PATH )
The fact is that in my dev/integration environments I had libsybdb.so.5 in my path, but not in my production environment.
So whatever Qt plugins you need make sure to copy the plugin directory ( with only the .so inside ) to your production environment. And Also make sure that performing:
@ldd /my/App/Path/sqldrivers/libsybdb.so.5@
will not print any "not found" as these dependency will not appear with:
@ldd /my/App/Path/myAppBin@