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. Cant connect to database if application is not opened via QT creator

Cant connect to database if application is not opened via QT creator

Scheduled Pinned Locked Moved Unsolved General and Desktop
12 Posts 5 Posters 3.4k 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.
  • M Offline
    M Offline
    mardzo
    wrote on 19 Jan 2017, 15:09 last edited by mardzo
    #1

    I have used this guide https://wiki.qt.io/Deploy_an_Application_on_Windows in order to deploy my application for another PC. The problem is that my application wont connect to my SQLite database if i start it on another PC. I have copied all the plugins from QT installation including the sql drivers. The interesting thing is if i follow the guide and rename QT installation folder to QTHidden, the application on the development machine also wont connect to the database . So i figure i am missing something from the QT Folder. Any suggestions?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 19 Jan 2017, 15:16 last edited by
      #2

      Hi
      yes, use http://www.dependencywalker.com/
      and check the the exe and the sql plugin if it has other
      requirements not copied.

      Alternativ also try with
      http://doc.qt.io/qt-5/windows-deployment.html

      and see what it copies.

      1 Reply Last reply
      1
      • M Offline
        M Offline
        mardzo
        wrote on 19 Jan 2017, 15:44 last edited by
        #3

        the windeployqt wont start on my machine. The dependency walker says it cant find
        LIBGCC_S_DW2-1.DLL
        LIBSTDC++-6.DLL
        QT5CORE.DLL
        QT5SQL.DLL

        but they are in the folder. :(

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 19 Jan 2017, 15:48 last edited by
          #4

          -the windeployqt wont start on my machine.

          Really ?
          What does it say ?

          Also, just for check. This is a release .exe u are testing with?

          Also did u run Walker on the SQL plugin and see if it needs extra?
          Its often something like that.

          M 1 Reply Last reply 19 Jan 2017, 15:54
          0
          • T Offline
            T Offline
            the_
            wrote on 19 Jan 2017, 15:49 last edited by
            #5

            Did you have a look at http://doc.qt.io/qt-5/windows-deployment.html as suggested by @mrjj?

            The windeployqt will copy all neccessary (Qt) dll files and folders into the folder where your compiled exe file is. In case of SQL you will also need the sqldrivers folder and the dll file(s) in there.

            -- No support in PM --

            M 1 Reply Last reply 19 Jan 2017, 15:55
            1
            • M mrjj
              19 Jan 2017, 15:48

              -the windeployqt wont start on my machine.

              Really ?
              What does it say ?

              Also, just for check. This is a release .exe u are testing with?

              Also did u run Walker on the SQL plugin and see if it needs extra?
              Its often something like that.

              M Offline
              M Offline
              mardzo
              wrote on 19 Jan 2017, 15:54 last edited by mardzo
              #6

              @mrjj I double click on the windeployqt, and window shows up for a second, but then it disappears. Yes, this is a release exe

              T J 2 Replies Last reply 19 Jan 2017, 15:56
              0
              • T the_
                19 Jan 2017, 15:49

                Did you have a look at http://doc.qt.io/qt-5/windows-deployment.html as suggested by @mrjj?

                The windeployqt will copy all neccessary (Qt) dll files and folders into the folder where your compiled exe file is. In case of SQL you will also need the sqldrivers folder and the dll file(s) in there.

                M Offline
                M Offline
                mardzo
                wrote on 19 Jan 2017, 15:55 last edited by
                #7

                @the_ I already have the sqldrivers folder in my release folder and it contains the dlls

                1 Reply Last reply
                0
                • M mardzo
                  19 Jan 2017, 15:54

                  @mrjj I double click on the windeployqt, and window shows up for a second, but then it disappears. Yes, this is a release exe

                  T Offline
                  T Offline
                  the_
                  wrote on 19 Jan 2017, 15:56 last edited by
                  #8

                  @mardzo said in Cant connect to database if application is not opened via QT creator:

                  @mrjj I double click on the windeployqt, and window shows up for a second, but then it disappears

                  It is a commandline tool, so you can not just double click it from the file browser.

                  -- No support in PM --

                  1 Reply Last reply
                  2
                  • M mardzo
                    19 Jan 2017, 15:54

                    @mrjj I double click on the windeployqt, and window shows up for a second, but then it disappears. Yes, this is a release exe

                    J Offline
                    J Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on 20 Jan 2017, 05:47 last edited by
                    #9

                    @mardzo said in Cant connect to database if application is not opened via QT creator:

                    I double click on the windeployqt, and window shows up for a second, but then it disappears. Yes, this is a release exe

                    You should read its documentation and not just double click on it (it is a command line tool not a GUI application).

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    1
                    • M Offline
                      M Offline
                      mardzo
                      wrote on 20 Jan 2017, 16:42 last edited by
                      #10

                      Im sorry guys i have never used it before. But now i did and windeployqt copied the same folder sqldrivers and also the others needed imageformats, platforms etc... I still have the same problem. If a Qt installation is not present, i cant connect to the db

                      M A 2 Replies Last reply 20 Jan 2017, 19:17
                      1
                      • M mardzo
                        20 Jan 2017, 16:42

                        Im sorry guys i have never used it before. But now i did and windeployqt copied the same folder sqldrivers and also the others needed imageformats, platforms etc... I still have the same problem. If a Qt installation is not present, i cant connect to the db

                        M Offline
                        M Offline
                        mrjj
                        Lifetime Qt Champion
                        wrote on 20 Jan 2017, 19:17 last edited by
                        #11

                        @mardzo
                        Ok super. then all Qt dlls should be ok. (hopefully)

                        Did you also check the actual sql plug with walker ?
                        to see if all is ok DLL wise ?

                        1 Reply Last reply
                        2
                        • M mardzo
                          20 Jan 2017, 16:42

                          Im sorry guys i have never used it before. But now i did and windeployqt copied the same folder sqldrivers and also the others needed imageformats, platforms etc... I still have the same problem. If a Qt installation is not present, i cant connect to the db

                          A Offline
                          A Offline
                          ambershark
                          wrote on 21 Jan 2017, 06:47 last edited by
                          #12

                          @mardzo said in Cant connect to database if application is not opened via QT creator:

                          Im sorry guys i have never used it before. But now i did and windeployqt copied the same folder sqldrivers and also the others needed imageformats, platforms etc... I still have the same problem. If a Qt installation is not present, i cant connect to the db

                          What does your directory structure look like for your app after windeploy?

                          It should be something like this:

                          <root of your app>
                             plugins/
                                images/
                                platforms/
                                sqldrivers/
                             *.exe
                             *.dll
                          

                          Then you may also need a qt.conf file with this in the root of your app:

                          [Paths]
                          Plugins = plugins
                          

                          That should get you working and connected.

                          My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

                          1 Reply Last reply
                          2

                          6/12

                          19 Jan 2017, 15:54

                          • Login

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