Page 2 of 2 FirstFirst 12
Results 21 to 39 of 39

Thread: Regading Driver to connect Postgresql Database

  1. #21
    Join Date
    Feb 2009
    Posts
    39
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Regading Driver to connect Postgresql Database

    Hi i think you are busy?? i sent the result after executing your specified instruction. What should i do. I am waiting for your reply


    Regards,

    Narasimha Raju. Naidu

  2. #22
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Regading Driver to connect Postgresql Database

    Quote Originally Posted by dummystories View Post
    thanks for your reply. i did according to your instructions but i got the following result



    C:\Qt\4.3.4\src\plugins\sqldrivers\psql>qmake "INCLUDEPATH+=C:\Program Files\Pos
    tgreSQL\8.3\include"
    "LIBS+=c:\Program Files\PostgreSQL\8.3\lib\libpq.a" psql.pr
    o

    C:\Qt\4.3.4\src\plugins\sqldrivers\psql>mingw32-make
    mingw32-make -f Makefile.Release
    mingw32-make[1]: Entering directory `C:/Qt/4.3.4/src/plugins/sqldrivers/psql'
    g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT
    -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_NO_DEBUG -DQT_PLUGIN
    -DQT_SQL_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\include\QtCore" -
    I"..\..\..\..\include\QtCore" -I"..\..\..\..\include\QtSql" -I"..\..\..\..\inclu
    de\QtSql" -I"..\..\..\..\include" -I"c:\Program" -I"Files\PostgreSQL\8.3\include
    "
    -I"c:\Qt\4.3.4\include\ActiveQt" -I"tmp\moc\release_shared" -I"." -I"..\..\..\
    ..\mkspecs\win32-g++" -o tmp\obj\release_shared\qsql_psql.o ..\..\..\sql\drivers


    Narasimha Raju
    Problem is with spaces in Yours PostgreSQL dir name (c:\Program Files\PostgreSQL\8.3). Try this :

    Qt Code:
    1. qmake INCLUDEPATH+="C:\Program Files\Pos
    2. tgreSQL\8.3\include" LIBS+="c:\Program Files\PostgreSQL\8.3\lib\libpq.a" psql.pr
    3. o
    To copy to clipboard, switch view to plain text mode 
    Look at differently located char " in INCLUDEPATH and LIBS.

  3. #23
    Join Date
    Feb 2009
    Posts
    39
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Regading Driver to connect Postgresql Database

    Hi,

    Good Morning, Thanks for your reply. I did changes what you mentiond in ur reply. I got the following output.


    C:\Qt\4.3.4\src\plugins\sqldrivers\psql>qmake INCLUDEPATH="c:\Program Files\Post
    greSQL\8.3\include" LIBS+="c:\Program Files\PostgreSQL\8.3\lib\libpq.a" psql.pro


    C:\Qt\4.3.4\src\plugins\sqldrivers\psql>mingw32-make
    mingw32-make -f Makefile.Release
    mingw32-make[1]: Entering directory `C:/Qt/4.3.4/src/plugins/sqldrivers/psql'
    g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
    oc -Wl,-s -mthreads -Wl -shared -Wl,--out-implib,c:\Qt\4.3.4\plugins\sqldrivers\
    libqsqlpsql4.a -o ..\..\..\..\plugins\sqldrivers\qsqlpsql4.dll tmp/obj/release_s
    hared/main.o tmp/obj/release_shared/qsql_psql.o tmp/obj/release_shared/moc_qsql_
    psql.o -L"c:\Qt\4.3.4\lib" -L"c:\Qt\4.3.4\lib" tmp\obj\release_shared\qsqlpsql_
    resource_res.o c:\Program Files\PostgreSQL\8.3\lib\libpq.a -lQtSql4 -lQtCore4
    g++: c:\Program: No such file or directory
    g++: Files\PostgreSQL\8.3\lib\libpq.a: No such file or directory
    mingw32-make[1]: *** [..\..\..\..\plugins\sqldrivers\qsqlpsql4.dll] Error 1
    mingw32-make[1]: Leaving directory `C:/Qt/4.3.4/src/plugins/sqldrivers/psql'
    mingw32-make: *** [release] Error 2


    I am waiting for your reply.


    Regards,

    Narasimha Raju. Naidu

  4. #24
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Regading Driver to connect Postgresql Database

    reinstall PostgreSQL in other directory which will not contain any spaces and reapeat all steps again. now the problem only in paths with spaces.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  5. #25
    Join Date
    Feb 2009
    Posts
    39
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Regading Driver to connect Postgresql Database

    Thanks for your reply. According to ur instructions i did the same thing. I got the following output


    C:\MinGW\bin>dlltool --dllname libpq.dll --def libpq.def --output-lib libpq.a
    dlltool: Can't open def file: libpq.def

    C:\MinGW\bin>



    Waiting for your reply

    Regards,

    Narasimha Raju. Naidu

  6. #26
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Regading Driver to connect Postgresql Database

    read the post #13 and read Creating .def Files from DLLs section from specified link.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  7. #27
    Join Date
    Feb 2009
    Posts
    39
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Regading Driver to connect Postgresql Database

    Thanks for your reply. According to your instructions

    I tried to downolad impdef.exe but i got an error file not found error.

    Waiting for your reply

    Regards,

    Narasimha Raju. Naidu

  8. #28
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Regading Driver to connect Postgresql Database

    try this or direct link
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  9. #29
    Join Date
    Feb 2009
    Posts
    39
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Regading Driver to connect Postgresql Database

    Thanks for your reply.

    I downloaded required file and executed the command. it generated one file. where should i keep this .def file
    it contains "Couldn't open file with CreateFile()"


    waiting for your reply.

    Regards,

    Narasimha Raju. Naidu

  10. #30
    Join Date
    Feb 2009
    Posts
    39
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Regading Driver to connect Postgresql Database

    Hi,

    i did one thing, i copied the downloaded file into postgre lib directory and executed the command and it generated one file with some text.

    what should i do now. where should i keep newly generated file


    Waiting for your reply


    Regards,


    Narasimha Raju. Naidu

  11. #31
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Regading Driver to connect Postgresql Database

    looks like you don't want to read links which I've posted. all instructions which I've posted are enought for successful building PSQL driver.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  12. #32
    Join Date
    Feb 2009
    Posts
    39
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Regading Driver to connect Postgresql Database

    No not like that. Just i am confirming what i need to do.


    Regards,

    Narasimha Raju. Naidu

  13. #33
    Join Date
    Feb 2009
    Posts
    39
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Regading Driver to connect Postgresql Database

    I successfully generated libpq.a file

    libpq.a file is at MinGW\bin. Is it the right place to keep or i need to move some where else

    Dont feel bad, I am in full pressure of my TL.

    Regards,


    Narasimha Raju. Naidu

  14. #34
    Join Date
    Feb 2009
    Posts
    39
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Regading Driver to connect Postgresql Database

    Hi,

    I run the following commands and i got the following result.

    C:\Qt\4.3.4>cd src\plugins\sqldrivers\psql

    C:\Qt\4.3.4\src\plugins\sqldrivers\psql>qmake INCLUDEPATH+="e:\ProgramFiles\Post
    greSQL\8.3\include" LIBS+="e:\ProgramFiles\PostgreSQL\8.3\lib\libpq.a" psql.pro

    C:\Qt\4.3.4\src\plugins\sqldrivers\psql>mingw32-make
    mingw32-make -f Makefile.Release
    mingw32-make[1]: Entering directory `C:/Qt/4.3.4/src/plugins/sqldrivers/psql'
    g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
    oc -Wl,-s -mthreads -Wl -shared -Wl,--out-implib,c:\Qt\4.3.4\plugins\sqldrivers\
    libqsqlpsql4.a -o ..\..\..\..\plugins\sqldrivers\qsqlpsql4.dll tmp/obj/release_s
    hared/main.o tmp/obj/release_shared/qsql_psql.o tmp/obj/release_shared/moc_qsql_
    psql.o -L"c:\Qt\4.3.4\lib" -L"c:\Qt\4.3.4\lib" tmp\obj\release_shared\qsqlpsql_
    resource_res.o e:\ProgramFiles\PostgreSQL\8.3\lib\libpq.a -lQtSql4 -lQtCore4
    Creating library file: c:\Qt\4.3.4\plugins\sqldrivers\libqsqlpsql4.a
    mingw32-make[1]: Leaving directory `C:/Qt/4.3.4/src/plugins/sqldrivers/psql'

    C:\Qt\4.3.4\src\plugins\sqldrivers\psql>


    I think it successfully generated driver, but i did not get where it generated. If it generated driver where it will located.

    What are the steps i need to do to run successfully my application.


    Regards,


    Narasimha Raju. Naidu

  15. #35
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Regading Driver to connect Postgresql Database

    look at QTDIR/plugins/sqldrivers. try to run QTDIR/demos/sqlbrowser.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  16. #36
    Join Date
    Feb 2009
    Posts
    39
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Regading Driver to connect Postgresql Database

    Hi,


    Thanks for your help. After running my application i got the following output.


    E:\qt\kk>ruby iccms_main.rb
    QSqlDatabase: QPSQL driver not loaded
    QSqlDatabase: available drivers: QSQLITE QODBC3 QODBC
    QSqlQuery::exec: database not open
    Tue Feb 24 2009
    ####
    Tue Feb 24 2009
    $$$$
    QSqlDatabase: QPSQL driver not loaded
    QSqlDatabase: available drivers: QSQLITE QODBC3 QODBC
    QSqlDatabasePrivate::removeDatabase: connection 'qt_sql_default_connection' is s
    till in use, all queries will cease to work.
    QSqlDatabasePrivate::addDatabase: duplicate connection name 'qt_sql_default_conn
    ection', old connection removed.
    Failed to open connection
    i am at Dbase
    i am busy with Systems
    QSqlQuery::exec: database not open
    QSqlDatabase: QPSQL driver not loaded
    QSqlDatabase: available drivers: QSQLITE QODBC3 QODBC
    QSqlDatabasePrivate::removeDatabase: connection 'qt_sql_default_connection' is s
    till in use, all queries will cease to work.
    QSqlDatabasePrivate::addDatabase: duplicate connection name 'qt_sql_default_conn
    ection', old connection removed.


    Regards,

    Narasimha Raju. Naidu

  17. #37
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Regading Driver to connect Postgresql Database

    put sqldrivers dir with your executable.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  18. #38
    Join Date
    Feb 2009
    Posts
    39
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Regading Driver to connect Postgresql Database

    Hi,


    Sorry to say, still i am getting the same error.

    Regards,

    Narasimha Raju. Naidu

  19. #39
    Join Date
    Feb 2009
    Posts
    39
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Regading Driver to connect Postgresql Database

    Hi,

    Sorry for my late reply. from last two weeks i am out of station. After comming back i completly worked on new system and installed all softwares and database. Then after i opend your replies on this site and followed all the instructions. After few hours i sucessfully created psqlqsql4.dll and libqsqlpsql4.a files at c:\Qt4\4.3.4\plugins\sqldrivers along with qsqlite4.dll and qsqlodbc4.dll.

    But still i am getting the same error what before i got. What should i do now. I copied all the dlls in to my working directory but still i am getting the same error.

    Waiting for your reply.

    Regrads,

    Narasimha Raju

Similar Threads

  1. Replies: 5
    Last Post: 28th August 2006, 15:36

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.