Plugin Load Problem
-
I'm development a software that need to load a lib("libmacdocktile.dylib") to show text in dock icon, imitating cocoa behavior.
@QPluginLoader* loader = new QPluginLoader(plugins.at(i));
QObject *o = loader->instance();
@
plugins.at(i) denote the absolute path of the lib
(it's /Users/patricklee/space/uHub/uHub/uHub.app/Contents/MacOS/docktile/libmacdocktile.dylib in my dev environment).When I run it in Qt, it works fine and successfully loaded to o.
But when I run outside,
change to /Users/patricklee/space/uHub/uHub/, and open uHub.app, or
change to /Users/patricklee/space/uHub/uHub/uHub.app/Contents/MacOS, and open uhub,
the lib doesn't load and return 0x00 to o.How to make it work outside qt?
-
How do you find the absolute path? Is it correct?