Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. QPSL driver is not loaded Win10 MSVC 2015 x64
Forum Updated to NodeBB v4.3 + New Features

QPSL driver is not loaded Win10 MSVC 2015 x64

Scheduled Pinned Locked Moved Solved Installation and Deployment
11 Posts 2 Posters 4.1k Views 1 Watching
  • 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.
  • koronaboraK Offline
    koronaboraK Offline
    koronabora
    wrote on last edited by
    #2

    I builded psql plugin using msvc compiler with postgres 9.5.2. Nothing changed.

    Please, could anybody say how to debug this situation: why plugin is not loading? There are no logs about this.

    Thank you!

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #3

      Hi and welcome to devnet,

      Do you also have the folder where the PostgreSQL dlls are in your PATH environment variable ? If not, then simply got to the run part of the Project panel and add it there.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      koronaboraK 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        Do you also have the folder where the PostgreSQL dlls are in your PATH environment variable ? If not, then simply got to the run part of the Project panel and add it there.

        koronaboraK Offline
        koronaboraK Offline
        koronabora
        wrote on last edited by koronabora
        #4

        @SGaist
        Yes, global %PATH% includes paths to PostgreSQL's dlls:
        https://yadi.sk/i/DP7N4Xx8qvCSB

        And these dll is in a root near a project binaries:

        ssleay32.dll, iconv.dll, libeay32.dll, libiconv-2.dll, libintl-8.dll, libpq.dll, libxml2.dll, libxslt.dll, zlib1.dll

        P.S.

        I'm modified psql driver code by appending some output to console, but nothing appears at console after driver loading:

        QSqlDriver* QPSQLDriverPlugin::create(const QString &name)
        {
            if (name == QLatin1String("QPSQL") || name == QLatin1String("QPSQL7")) {
                QPSQLDriver* driver = new QPSQLDriver();
                std::cout << "Driver loaded by main";
                return driver;
            }
            std::cout << "Driver not loaded by main";
            return 0;
        }
        
        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #5

          After re-reading your plugin loading output, there something strange, did you copy the plugin in your application after building it ?

          It should rather go in Qt's plugins SQL sub folder

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • koronaboraK Offline
            koronaboraK Offline
            koronabora
            wrote on last edited by
            #6

            I'm sorry.

            Using command line to start application:

            @echo off
            MoneyManagement.exe > out.txt
            

            I see this in file "out.txt":

            Driver loaded by main
            

            In lastSqlError variable the same:

            Driver not loaded Driver not loaded
            

            And there are no error messages in MSVC output.

            What I have to do?

            P.S.

            After appending debug output to all methods inside "qsql_psql_p.h" I saw this:

            Plugin consructor called.
            private sql driver constructor called
            QPSQLDriver constructor 1
            Driver loaded by mainQPSQLDriver close
            QPSQLDriver isOpen
            QPSQLDriver destructor
            
            
            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #7

              After re-reading your code sample I just realized: you're using QSqlDatabase wrongly. You are currently trying to open an invalid database object.

              addDatabase is a static function. See the detailed description of QSqlDatabase to see how it's done

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              koronaboraK 1 Reply Last reply
              1
              • SGaistS SGaist

                After re-reading your code sample I just realized: you're using QSqlDatabase wrongly. You are currently trying to open an invalid database object.

                addDatabase is a static function. See the detailed description of QSqlDatabase to see how it's done

                koronaboraK Offline
                koronaboraK Offline
                koronabora
                wrote on last edited by
                #8

                @SGaist

                Thank you again!

                _sqlBase = new QSqlDatabase();
                	*_sqlBase = QSqlDatabase::addDatabase(_SQL_DRIVER); //"QPSQL"
                

                Now all is ok.

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #9

                  That's wrong, don't allocate _sqlBase on the heap.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  koronaboraK 1 Reply Last reply
                  0
                  • SGaistS SGaist

                    That's wrong, don't allocate _sqlBase on the heap.

                    koronaboraK Offline
                    koronaboraK Offline
                    koronabora
                    wrote on last edited by
                    #10

                    @SGaist

                    Could you explain to me, why?
                    Thank you.

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #11

                      One of the reason is explained in QSqlDatbase::removeDatabase.

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      1

                      • Login

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