[CLOSED] app executable can't find plugins



  • H​i
    in my application main function i have below code to check for plugins:
    @app.addLibraryPath(":/plugins/crypto");
    QCA::Initializer qcaInit;​
    ​if(!QCA::isSupported(" ​sha1") || !QCA::isSupported(" ​pkey"))
    {
    QMessageBox::information(NULL, "Error", "No cryptocraphic library could be found! application is exiting.");
    return 1;
    }@

    when i run this within Qt, it is perfectly working but when run the executable in another machine it always returns 1!
    i have copied qca-ossl and qca-pkcs11 dlls onto plugins/crypto folder


  • Lifetime Qt Champion

    Hi,

    Your path seems strange.

    ":/plugins/crypto" points to a folder in your resources. Is it a typo here ? Or in your code ?



  • this code also is not working!

    @app.addLibraryPath(app.applicationDirPath() + "/" + "plugins" + "/" + "imageformats");
    app.addLibraryPath(app.applicationDirPath() + "/" + "plugins" + "/" + "crypto");
    QStringList listAppLibPaths = QCoreApplication::libraryPaths();
    foreach (QString str, listAppLibPaths)
    {
    Message::information("Path", str);
    }
    QCA::ProviderList listProviders = QCA::providers();
    listProviders += QCA::defaultProvider();
    foreach (QCA::Provider *provider, listProviders)
    {
    Message::information("Provider Name:", provider->name());
    }

    QStringList listFeathures;
    listFeathures.append("cert");
    listFeathures.append("cms");
    listFeathures.append("smartcard");
    if(!QCA::isSupported(listFeathures))
    {
        Message::error(QObject::tr("Error"), "No cryptographic library could be found! application is exiting.");
        return 1;
    }@
    

    appPath: is application executable path

    listAppLibPaths: will contain appPath, appPath/plugins/imageformats, appPath/plugins/crypto
    listProviders: will contain only defualt provider if i copy crypto folder to appPath/plugins/crypto folder, so none of my cryptographic plugins are found in appPath/plugins/crypto folder!
    listProviders: will contain defualt provider and qca-ossl if i copy crypto folder to appPath folder
    by the way, qca-pkcs11 is never found!


  • Lifetime Qt Champion

    Did you try to contact the QCA guys to see whether there's an explained way to do it ?



  • yes i sent an email! however they answer every 3 days !!
    i could solve some part of it by creating a sub-directory of appPath/crypto/crypto and copying the plugins inside it. now when i run this on another machine it is working properly but inside qt i just have access to qca-pkcs11
    and QCA::pluginDiagnosticText() tells me:
    qca-ossld2.dll: failed to load: Cannot load library C:/QtSDK/Desktop/Qt/4.7.4/mingw/plugins/crypto/qca-ossld2.dll:
    qca-pkcs11d2.dll: (class: pkcs11Plugin) loaded as qca-pkcs11
    thanks for your concern :-)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.