Results 1 to 7 of 7

Thread: qpsql driver Qt 5.0.1 postgresql 9.2.3

  1. #1
    Join Date
    May 2013
    Location
    Schweiz
    Posts
    21
    Thanked 1 Time in 1 Post
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Windows

    Default qpsql driver Qt 5.0.1 postgresql 9.2.3

    hello,

    I'm Newbie and i would like to create the QPSQL driver for Windows. I'm running a Win xp sp3 system and I would like to connect from Qt 5.0.1 to postgresql 9.2.3.

    Here are the database drivers described, but I think this is not actual for Qt 5.0.1, because I can't find the following dir "src/...":

    cd $QTDIR/src/plugins/sqldrivers/psql - i don't have this src folder in my structure.

    are you aware of some other, more actual instructions I could follow to create this driver?

    thanks for your input.

  2. The following user says thank you to avpro for this useful post:


  3. #2
    Join Date
    Mar 2006
    Location
    Jarrell, Texas, USA
    Posts
    70
    Thanks
    7
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: qpsql driver Qt 5.0.1 postgresql 9.2.3

    The sources for the sqldrivers is now under the Src/qtbase subdirectory.
    Win32 example: C:\Qt\5.0.1\Src\qtbase
    POSIX example: /Qt/5.0.1/Src/qtbase

    Karl

  4. #3
    Join Date
    May 2013
    Location
    Schweiz
    Posts
    21
    Thanked 1 Time in 1 Post
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Windows

    Default Re: qpsql driver Qt 5.0.1 postgresql 9.2.3

    hi Karl,

    thanks for your feedback. i have the following structure:

    Untitled-1.jpg

    the SRC folder is missing.

    any idea?

  5. #4
    Join Date
    Mar 2006
    Location
    Jarrell, Texas, USA
    Posts
    70
    Thanks
    7
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: qpsql driver Qt 5.0.1 postgresql 9.2.3

    Did you install from sources or binaries?
    If you installed from the binary installer, then you needed to tell the installer to install the source packages. It does not do this by default.
    If you installed from sources, then the sqldrivers folder is in the source tree.

    Karl

  6. The following user says thank you to KaptainKarl for this useful post:


  7. #5
    Join Date
    May 2013
    Location
    Schweiz
    Posts
    21
    Thanked 1 Time in 1 Post
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Windows

    Default Re: qpsql driver Qt 5.0.1 postgresql 9.2.3

    Quote Originally Posted by KaptainKarl View Post
    Did you install from sources or binaries?
    If you installed from the binary installer, then you needed to tell the installer to install the source packages. It does not do this by default.
    If you installed from sources, then the sqldrivers folder is in the source tree.

    Karl
    I've reinstalled QT with sources. I found the files and i started the process of creating the qpsql driver from QT command line.
    i used these instructions [qt-project.org] to bild my qpsql driver. everything went fine until here:

    cd QTDIR\src\plugins\sqldrivers\psql qmake “INCLUDEPATH+=C:\psql\include” “LIBS+=C:\psql\lib\ms\libpq.lib” psql.pro

    after this I’m supposed to lunch the nmake command. unfortunately, nmake is not working.
    i received this error: “nmake is not recognized as an internal or external command operable program or batch file”

    1. any idea why i receive this error?
    2. any idea if the qpsql driver is complete?
    3. any idea how could i test the qpsql driver?

    thanks for your input.

  8. #6
    Join Date
    Mar 2006
    Location
    Jarrell, Texas, USA
    Posts
    70
    Thanks
    7
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: qpsql driver Qt 5.0.1 postgresql 9.2.3

    1. You must execute the vcvarsall.bat file within the shell where you intend to build the plugin in order to set up the environment for visual studio. By default, the batch file is located in C:\Program Files\Microsoft Visual Studio 10.0\VC.

    2. It is not complete if it did not compile.

    3. Build the Sql Browser example from the Qt examples. Verify the QPSQL driver is in the driver list. Execute a query against an existing database.

    OR

    Create a Qt Console app with the following code:

    Qt Code:
    1. qDebug() << QSqlDatabase::drivers();
    2. QSqlDatabase db( QSqlDatabase::addDatabase( "QPSQL" ) );
    3. qDebug() << db.lastError();
    To copy to clipboard, switch view to plain text mode 

    Karl

  9. #7
    Join Date
    May 2013
    Location
    Schweiz
    Posts
    21
    Thanked 1 Time in 1 Post
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Windows

    Default Re: qpsql driver Qt 5.0.1 postgresql 9.2.3

    i'm back,

    i reinstalled postgresql in C:\psql
    i run qmake command
    i run mingw32-make and this error was the output:

    C:\Qt\Qt5.0.2\5.0.2\Src\qtbase\src\plugins\sqldriv ers\psql>mingw32-make debug
    mingw32-make -f Makefile.Debug
    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"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++" -o .obj\debug_sha
    red\qsql_psql.o ..\..\..\sql\drivers\psql\qsql_psql.cpp
    In file included from c:\qt\qt5.0.2\tools\mingw\bin\../lib/gcc/i686-w64-mingw32/
    4.7.2/include/c++/i686-w64-mingw32/bits/gthr-default.h:41:0,
    from c:\qt\qt5.0.2\tools\mingw\bin\../lib/gcc/i686-w64-mingw32/
    4.7.2/include/c++/i686-w64-mingw32/bits/gthr.h:150,
    from c:\qt\qt5.0.2\tools\mingw\bin\../lib/gcc/i686-w64-mingw32/
    4.7.2/include/c++/ext/atomicity.h:34,
    from c:\qt\qt5.0.2\tools\mingw\bin\../lib/gcc/i686-w64-mingw32/
    4.7.2/include/c++/bits/basic_string.h:41,
    from c:\qt\qt5.0.2\tools\mingw\bin\../lib/gcc/i686-w64-mingw32/
    4.7.2/include/c++/string:54,
    from c:\qt\qt5.0.2\tools\mingw\bin\../lib/gcc/i686-w64-mingw32/
    4.7.2/include/c++/random:41,
    from c:\qt\qt5.0.2\tools\mingw\bin\../lib/gcc/i686-w64-mingw32/
    4.7.2/include/c++/bits/stl_algo.h:67,
    from c:\qt\qt5.0.2\tools\mingw\bin\../lib/gcc/i686-w64-mingw32/
    4.7.2/include/c++/algorithm:63,
    from C:\Qt\Qt5.0.2\5.0.2\mingw47_32\include/QtCore/qglobal.h:80
    ,
    from C:\Qt\Qt5.0.2\5.0.2\mingw47_32\include/QtCore/qatomic.h:42
    ,
    from C:\Qt\Qt5.0.2\5.0.2\mingw47_32\include/QtCore/qvariant.h:4
    5,
    from C:\Qt\Qt5.0.2\5.0.2\mingw47_32\include/QtSql/qsqlresult.h:
    45,
    from ..\..\..\sql\drivers\psql\qsql_psql.h:45,
    from ..\..\..\sql\drivers\psql\qsql_psql.cpp:42:
    C:\psql\include/pthread.h:307:8: error: redefinition of 'struct timespec'
    In file included from c:\qt\qt5.0.2\tools\mingw\bin\../lib/gcc/i686-w64-mingw32/
    4.7.2/../../../../i686-w64-mingw32/include/time.h:277:0,
    from C:\psql\include/pthread.h:218,
    from c:\qt\qt5.0.2\tools\mingw\bin\../lib/gcc/i686-w64-mingw32/
    4.7.2/include/c++/i686-w64-mingw32/bits/gthr-default.h:41,
    from c:\qt\qt5.0.2\tools\mingw\bin\../lib/gcc/i686-w64-mingw32/
    4.7.2/include/c++/i686-w64-mingw32/bits/gthr.h:150,
    from c:\qt\qt5.0.2\tools\mingw\bin\../lib/gcc/i686-w64-mingw32/
    4.7.2/include/c++/ext/atomicity.h:34,
    from c:\qt\qt5.0.2\tools\mingw\bin\../lib/gcc/i686-w64-mingw32/
    4.7.2/include/c++/bits/basic_string.h:41,
    from c:\qt\qt5.0.2\tools\mingw\bin\../lib/gcc/i686-w64-mingw32/
    4.7.2/include/c++/string:54,
    from c:\qt\qt5.0.2\tools\mingw\bin\../lib/gcc/i686-w64-mingw32/
    4.7.2/include/c++/random:41,
    from c:\qt\qt5.0.2\tools\mingw\bin\../lib/gcc/i686-w64-mingw32/
    4.7.2/include/c++/bits/stl_algo.h:67,
    from c:\qt\qt5.0.2\tools\mingw\bin\../lib/gcc/i686-w64-mingw32/
    4.7.2/include/c++/algorithm:63,
    from C:\Qt\Qt5.0.2\5.0.2\mingw47_32\include/QtCore/qglobal.h:80
    ,
    from C:\Qt\Qt5.0.2\5.0.2\mingw47_32\include/QtCore/qatomic.h:42
    ,
    from C:\Qt\Qt5.0.2\5.0.2\mingw47_32\include/QtCore/qvariant.h:4
    5,
    from C:\Qt\Qt5.0.2\5.0.2\mingw47_32\include/QtSql/qsqlresult.h:
    45,
    from ..\..\..\sql\drivers\psql\qsql_psql.h:45,
    from ..\..\..\sql\drivers\psql\qsql_psql.cpp:42:
    c:\qt\qt5.0.2\tools\mingw\bin\../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686
    -w64-mingw32/include/sys/timeb.h:90:8: error: previous definition of 'struct tim
    espec'
    Makefile.Debug:486: recipe for target '.obj/debug_shared/qsql_psql.o' failed
    mingw32-make[1]: *** [.obj/debug_shared/qsql_psql.o] Error 1
    mingw32-make[1]: Leaving directory 'C:/Qt/Qt5.0.2/5.0.2/Src/qtbase/src/plugins/s
    qldrivers/psql'
    makefile:48: recipe for target 'debug' failed
    mingw32-make: *** [debug] Error 2

    C:\Qt\Qt5.0.2\5.0.2\Src\qtbase\src\plugins\sqldriv ers\psql>


    any idea what is wrong? why i can't build the qpsql driver?
    thanks for your input

Similar Threads

  1. Replies: 4
    Last Post: 4th February 2013, 08:54
  2. QPSQL + QT4 (Postgresql driver bug)
    By l2succes in forum Qt Programming
    Replies: 8
    Last Post: 13th March 2011, 00:52
  3. Replies: 2
    Last Post: 11th February 2011, 18:53
  4. QPSQL driver not loaded
    By drave in forum Newbie
    Replies: 4
    Last Post: 4th May 2010, 14:11
  5. QPSQL driver in windows
    By brevleq in forum Installation and Deployment
    Replies: 31
    Last Post: 14th December 2007, 13:57

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.