Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How can i deploy a application with QCA library
QtWS25 Last Chance

How can i deploy a application with QCA library

Scheduled Pinned Locked Moved General and Desktop
7 Posts 3 Posters 5.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    zhangjunhua
    wrote on last edited by
    #1

    my application need ras and aes algorithm,so i use the QCA(Qt Cryptographic Architecture) ,
    then i follow the steps,and get two dll named qca2.dll and qca-ossl2.dll,so i can use them called the algorithm funtions and get the right result on my own pc.
    but the problem is that it can not run other's computers, i have logger it and find that the QCA's funtion do not run.
    so i can not deploy my application to others .
    please help me,thanks.

    1 Reply Last reply
    0
    • R Offline
      R Offline
      rcari
      wrote on last edited by
      #2

      See "that":http://delta.affinix.com/qca/ in the section How does it work?.
      You need to provide plugins with QCA so that it works properly. Those plugins must be placed in a 'crypto' subfolder of one of the folders in the Qt library paths.

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        zhangjunhua
        wrote on last edited by
        #3

        but how can i provide the QCA plugins with QT sdk properly.
        i only put a ‘crypto’ subfolder into the the path"QtSDK\Desktop\Qt\4.8.1\mingw\plugins",
        and copy "crypto.prf" and "winlocal.prf" in the path "QtSDK\Desktop\Qt\4.8.1\mingw\mkspecs\features".

        in my pro,
        i do the below:
        #QT += crypto
        QT += crypto.prf
        but the creator can not know it.

        so i put the lib and headers in my project without QT sdk like this below:
        INCLUDEPATH += $$quote(qca-2.0.3/include/QtCrypto)
        win32 {
        LIBS += -L$$quote(qca-2.0.3/lib) -lqca2
        }
        unix {
        LIBS += -L$$quote(qca-2.0.3/lib) -lqca
        }

        this link is releated with "http://www.essentialunix.org/index.php?option=com_content&view=article&id=48:qcatutorial&catid=34:qttutorials&Itemid=53http://".
        without QT sdk
        .
        in my computer the QCA works fine.

        but when i copy the release folder with needed dlls(QT dlls and QCA dlls(qca2.dll,qca-ossl2.dll,libeay32.dll,ssleay32.dll)) in other computer.it can not run.
        so i log it and find that when the QCA's Funtions is called and panic it .so i guess it can not loaded in other computer.
        so i do not know that why the QT complier can not load the QCA but it can load its internal Plugins.

        please tell me how can i run it in others computer without QT sdk anything.

        1 Reply Last reply
        0
        • Z Offline
          Z Offline
          zhangjunhua
          wrote on last edited by
          #4

          the post aboved.have a mistake.
          #QT += crypto
          QT += crypto.prf

          it is right here:
          #CONFIG += crypto.prf
          CONFIG += crypto
          so when adding this ,it will compile with QT sdk.but it is not useful for moving other computer.

          it also can not run other computers.

          everyone help me ,thanks a lot.

          1 Reply Last reply
          0
          • R Offline
            R Offline
            rcari
            wrote on last edited by
            #5

            The plugins come from QPA. They are DLLs and you must do the work of copying them to the right place yourself as QPA is not part of the Qt SDK. Read the QPA documentation.

            1 Reply Last reply
            0
            • M Offline
              M Offline
              maciej
              wrote on last edited by
              #6

              If you deploy your application, e.g. in C:\myapp, you should create new folder in this path (you can call it "plugins"). In that new folder you create other directories for external Qt plugins you need (e.g. "crypto" for QCA). Then you place required dll's there. After that, you sholud create file qt.conf in main directory (where exe resides), which sould contain following content:
              @[Paths]
              Plugins = plugins@

              To sum up, paths may look like this:
              C:\myapp - main folder
              C:\myapp\myapp.exe - executable
              C:\myapp\qt.conf - configuration file with paths
              C:\myapp\plugins - directory containing plugin folders
              C:\myapp\plugins\crypto - directory with QCA dlls

              Earth is a beta site.

              1 Reply Last reply
              0
              • Z Offline
                Z Offline
                zhangjunhua
                wrote on last edited by
                #7

                thanks,i have resolved it.
                with the line below:
                #CONFIG += crypto.prf
                CONFIG += crypto

                the resolved ways:

                eg:
                C:\myapp is my root folder;
                so
                executable
                C:\myapp\myapp.exe – executable

                qt's dll
                c:\myapp\QtCore4.dll ---qt's dll
                ....
                c:\myapp\QtGui4.dll ---qt's dll

                QCA'S dll
                c:\myapp\qca2.dll,qca-ossl2.dll,libeay32.dll,ssleay32.dll

                QT's plugins
                (here you can copy QT's plugins to your root folder)
                c:\myapp\plugins\codecs
                ....
                c:\myapp\plugins\sqldrivers
                c:\myapp\plugins\crypto(here must be contain the QCA's DLL for load)

                so the all needed dlls are completion.

                you must write code below:
                int main(int argc, char *argv[])
                {
                QApplication a(argc, argv);

                //set the loading plugins path.
                qApp->addLibraryPath(qApp->applicationDirPath());
                qApp->addLibraryPath(qApp->applicationDirPath() + "/plugins");
                
                //init QCA dll
                QCA::Initializer init;
                

                QTextCodec::setCodecForLocale(QTextCodec::codecForLocale());
                QTextCodec::setCodecForCStrings(QTextCodec::codecForLocale());
                QTextCodec::setCodecForTr(QTextCodec::codecForLocale());

                BankClient w;
                w.show();
                return a.exec();
                }

                so you can run the application in any window PC wihout creator.
                so there are your deploying componts.

                at last i must thank maciek ,
                he offer a config file "qt.conf" to set the libray path .
                like with my code aboved.
                i have not try this method.
                i think it is a good way mentioned in QT sdk help.

                http://qt-project.org/doc/qt-4.8/deployment-windows.html
                http://qt-project.org/doc/qt-4.8/qt-conf.html

                but there is a questions about QCA????
                the qca's dll have two paths.
                1.c:\myapp
                2.c:\myapp\plugins
                if i delete any of it ,the application will not run.
                so it is a question for me ,
                Is any one know why does it.

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved