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. QPSQL Plugin on Windows
Forum Updated to NodeBB v4.3 + New Features

QPSQL Plugin on Windows

Scheduled Pinned Locked Moved General and Desktop
23 Posts 4 Posters 14.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.
  • A Offline
    A Offline
    angelicaP
    wrote on last edited by
    #21

    not yet, but i will give a try

    1 Reply Last reply
    0
    • A Offline
      A Offline
      angelicaP
      wrote on last edited by
      #22

      i integrated the LIBS+=-LC:/psql/folder_where_libqp_can_be_found
      in my psql.pro file like this:

      TARGET = qsqlpsql

      SOURCES = main.cpp
      OTHER_FILES += psql.json
      include(../../../sql/drivers/psql/qsql_psql.pri)

      PLUGIN_CLASS_NAME = QPSQLDriverPlugin
      include(../qsqldriverbase.pri)
      LIBS+=-LC:/psql/lib

      and got this output, surprisingly without errors; but the "driver not loaded" error still comes as soon as I test with
      @qDebug() << "Error = " << db.lastError().text();@

      C:\Qt\Qt5.0.2\5.0.2\Src\qtbase\src\plugins\sqldrivers\psql>mingw32-make
      C:\Qt\Qt5.0.2\5.0.2\mingw47_32\bin\qmake.exe "INCLUDEPATH+=C:\psql\includeö ôL
      IBS+=c:\psql\lib\libpq.libö psql.pro" -o Makefile psql.pro
      mingw32-make -f Makefile.Release all
      mingw32-make[1]: Entering directory 'C:/Qt/Qt5.0.2/5.0.2/Src/qtbase/src/plugins/
      sqldrivers/psql'
      g++ -Wl,-s -shared -Wl,--out-implib,C:\Qt\Qt5.0.2\5.0.2\Src\qtbase\plugins\sqldr
      ivers\libqsqlpsql.a -o ........\plugins\sqldrivers\qsqlpsql.dll .obj/release_
      shared/main.o .obj/release_shared/qsql_psql.o .obj/release_shared/moc_qsql_psql.
      o -Lc:\psql\lib -lpq -LC:/psql/lib -LC:\Qt\Qt5.0.2\5.0.2\mingw47_32\lib -lQt5Sq
      l -lQt5Core
      mingw32-make[1]: Leaving directory 'C:/Qt/Qt5.0.2/5.0.2/Src/qtbase/src/plugins/s
      qldrivers/psql'
      mingw32-make -f Makefile.Debug all
      mingw32-make[1]: Entering directory 'C:/Qt/Qt5.0.2/5.0.2/Src/qtbase/src/plugins/
      sqldrivers/psql'
      g++ -c -pipe -fno-keep-inline-dllexport -g -std=c++0x -fno-exceptions -frtti -Wa
      ll -Wextra -DUNICODE -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEP
      TIONS -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I. -I"C:\psql\includeö" -I"ôLIBS+=
      c:\psql\lib\libpq.libö" -I"psql.pro" -I"C:\Qt\Qt5.0.2\5.0.2\mingw47_32\include"
      -I"C:\Qt\Qt5.0.2\5.0.2\mingw47_32\include\QtSql" -I"C:\Qt\Qt5.0.2\5.0.2\mingw47_
      32\include\QtSql\5.0.2" -I"C:\Qt\Qt5.0.2\5.0.2\mingw47_32\include\QtSql\5.0.2\Qt
      Sql" -I"C:\Qt\Qt5.0.2\5.0.2\mingw47_32\include\QtCore" -I".moc\debug_shared" -I"
      ........\mkspecs\win32-g++" -o .obj\debug_shared\qsql_psql.o ......\sql\dri
      vers\psql\qsql_psql.cpp
      cc1plus.exe: warning: psql.pro: not a directory [enabled by default]
      C:\Qt\Qt5.0.2\5.0.2\mingw47_32\bin\moc.exe -DUNICODE -DQT_NO_CAST_TO_ASCII -DQT_
      NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I.
      -I"C:\psql\includeö" -I"ôLIBS+=c:\psql\lib\libpq.libö" -I"psql.pro" -I"C:\Qt\Qt
      5.0.2\5.0.2\mingw47_32\include" -I"C:\Qt\Qt5.0.2\5.0.2\mingw47_32\include\QtSql"
      -I"C:\Qt\Qt5.0.2\5.0.2\mingw47_32\include\QtSql\5.0.2" -I"C:\Qt\Qt5.0.2\5.0.2\m
      ingw47_32\include\QtSql\5.0.2\QtSql" -I"C:\Qt\Qt5.0.2\5.0.2\mingw47_32\include\Q
      tCore" -I".moc\debug_shared" -I"........\mkspecs\win32-g++" -D__GNUC__ -DWIN3
      2 ......\sql\drivers\psql\qsql_psql.h -o .moc\debug_shared\moc_qsql_psql.cpp
      g++ -c -pipe -fno-keep-inline-dllexport -g -std=c++0x -fno-exceptions -frtti -Wa
      ll -Wextra -DUNICODE -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEP
      TIONS -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I. -I"C:\psql\includeö" -I"ôLIBS+=
      c:\psql\lib\libpq.libö" -I"psql.pro" -I"C:\Qt\Qt5.0.2\5.0.2\mingw47_32\include"
      -I"C:\Qt\Qt5.0.2\5.0.2\mingw47_32\include\QtSql" -I"C:\Qt\Qt5.0.2\5.0.2\mingw47_
      32\include\QtSql\5.0.2" -I"C:\Qt\Qt5.0.2\5.0.2\mingw47_32\include\QtSql\5.0.2\Qt
      Sql" -I"C:\Qt\Qt5.0.2\5.0.2\mingw47_32\include\QtCore" -I".moc\debug_shared" -I"
      ........\mkspecs\win32-g++" -o .obj\debug_shared\moc_qsql_psql.o .moc\debug_s
      hared\moc_qsql_psql.cpp
      cc1plus.exe: warning: psql.pro: not a directory [enabled by default]
      g++ -shared -Wl,--out-implib,C:\Qt\Qt5.0.2\5.0.2\Src\qtbase\plugins\sqldrivers\l
      ibqsqlpsqld.a -o ........\plugins\sqldrivers\qsqlpsqld.dll .obj/debug_shared/
      main.o .obj/debug_shared/qsql_psql.o .obj/debug_shared/moc_qsql_psql.o -Lc:\psq
      l\lib -lpq -LC:/psql/lib -LC:\Qt\Qt5.0.2\5.0.2\mingw47_32\lib -lQt5Sqld -lQt5Cor
      ed
      mingw32-make[1]: Leaving directory 'C:/Qt/Qt5.0.2/5.0.2/Src/qtbase/src/plugins/s
      qldrivers/psql'

      after that i put the LIBS+=-LC:/psql/folder_where_libqp_can_be_found
      in my psql.pro file like this:

      TARGET = qsqlpsql

      SOURCES = main.cpp
      OTHER_FILES += psql.json
      include(../../../sql/drivers/psql/qsql_psql.pri)
      LIBS+=-LC:/psql/lib

      PLUGIN_CLASS_NAME = QPSQLDriverPlugin
      include(../qsqldriverbase.pri)

      and got this output,

      C:\Qt\Qt5.0.2\5.0.2\Src\qtbase\src\plugins\sqldrivers\psql>mingw32-make
      C:\Qt\Qt5.0.2\5.0.2\mingw47_32\bin\qmake.exe "INCLUDEPATH+=C:\psql\includeö ôL
      IBS+=c:\psql\lib\libpq.libö psql.pro" -o Makefile psql.pro
      mingw32-make -f Makefile.Release all
      mingw32-make[1]: Entering directory 'C:/Qt/Qt5.0.2/5.0.2/Src/qtbase/src/plugins/
      sqldrivers/psql'
      mingw32-make[1]: Nothing to be done for 'all'.
      mingw32-make[1]: Leaving directory 'C:/Qt/Qt5.0.2/5.0.2/Src/qtbase/src/plugins/s
      qldrivers/psql'
      mingw32-make -f Makefile.Debug all
      mingw32-make[1]: Entering directory 'C:/Qt/Qt5.0.2/5.0.2/Src/qtbase/src/plugins/
      sqldrivers/psql'
      mingw32-make[1]: Nothing to be done for 'all'.
      mingw32-make[1]: Leaving directory 'C:/Qt/Qt5.0.2/5.0.2/Src/qtbase/src/plugins/s
      qldrivers/psql'

      but the "driver not loaded" error still comes as soon as I test with
      @qDebug() << "Error = " << db.lastError().text();@

      1. which is the correct output?
      2. i think i should obtain the qsqlpsql.dll file after this is correctly created, which should be copied to c:[Qt]\mingw47_32\plugins\sqldrivers\

      what's wrong?
      thanks for your input

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

        I don't know if it's the copy/paste or something else, but you are having a lot of strange char in your mignw32-make output.

        And this line:
        @cc1plus.exe: warning: psql.pro: not a directory [enabled by default]@

        looks suspicious

        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

        • Login

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