Results 1 to 14 of 14

Thread: Problem compiling PostgreSQL driver with Qt-SDK 2010.02.01

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2008
    Posts
    196
    Thanked 8 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    1

    Default Problem compiling PostgreSQL driver with Qt-SDK 2010.02.01

    Hey @all,

    did anybody know the reason why the PostgreSQL driver can't be compiled with the "new" SDK?
    When I try to compile the driver i still get the error
    Qt Code:
    1. c:/qt/2010.02.1/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe:psql.pro: file format not recognized; treating as linker script
    2. c:/qt/2010.02.1/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe:psql.pro:1: syntax error
    To copy to clipboard, switch view to plain text mode 
    The psql.pro file isn't changed at all, but here it is:
    Qt Code:
    1. TARGET = qsqlpsql
    2.  
    3. HEADERS = ../../../sql/drivers/psql/qsql_psql.h
    4. SOURCES = main.cpp \
    5. ../../../sql/drivers/psql/qsql_psql.cpp
    6.  
    7. unix: {
    8. !isEmpty(QT_LFLAGS_PSQL) {
    9. LIBS *= $$QT_LFLAGS_PSQL
    10. QMAKE_CXXFLAGS *= $$QT_CFLAGS_PSQL
    11. }
    12. !contains(LIBS, .*pq.*):LIBS *= -lpq
    13. }
    14.  
    15. win32:!contains(LIBS, .*pq.* ) {
    16. !win32-g++:LIBS *= -llibpq
    17. win32-g++:LIBS *= -lpq
    18. LIBS *= -lws2_32 -ladvapi32
    19. }
    20.  
    21. include(../qsqldriverbase.pri)
    To copy to clipboard, switch view to plain text mode 

    I hope someone could help

    Best Regards
    NoRulez

  2. #2
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Problem compiling PostgreSQL driver with Qt-SDK 2010.02.01

    It looks like ld.exe wants to parse psql.pro. How you compile this Postgres plugin?

  3. #3
    Join Date
    Apr 2008
    Posts
    196
    Thanked 8 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    1

    Default Re: Problem compiling PostgreSQL driver with Qt-SDK 2010.02.01

    I've made it as described in the Qt documentation How to Build the QPSQL Plugin on Windows, but with mingw32-make instead.

    Best Regards
    NoRulez

  4. #4
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Problem compiling PostgreSQL driver with Qt-SDK 2010.02.01

    can you paste exact command you use?

  5. #5
    Join Date
    Apr 2008
    Posts
    196
    Thanked 8 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    1

    Default Re: Problem compiling PostgreSQL driver with Qt-SDK 2010.02.01

    Qt Code:
    1. cd %QTDIR%\src\plugins\sqldrivers\psql
    2. qmake "INCLUDEPATH+=C:\Databases\PostgreSQL\8.4\include" "LIBS+=C:\Databases\PostgreSQL\8.4\lib\libpq.lib" psql.pro
    3. mingw32-make
    To copy to clipboard, switch view to plain text mode 

    I also tried the following after reimp, but the same error message occurs
    Qt Code:
    1. qmake "INCLUDEPATH+=C:\Databases\PostgreSQL\8.4\include" "LIBS+=C:\Databases\PostgreSQL\8.4\lib\libpq.a" psql.pro
    To copy to clipboard, switch view to plain text mode 

    Best Regards
    NoRulez

  6. #6
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Problem compiling PostgreSQL driver with Qt-SDK 2010.02.01

    and what if you try this:
    Qt Code:
    1. qmake "INCLUDEPATH+=C:\Databases\PostgreSQL\8.4\include" "LIBS+=-LC:\Databases\PostgreSQL\8.4\lib -lpq" psql.pro
    To copy to clipboard, switch view to plain text mode 

  7. #7
    Join Date
    Apr 2008
    Posts
    196
    Thanked 8 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    1

    Default Re: Problem compiling PostgreSQL driver with Qt-SDK 2010.02.01

    OK, thank you

    i will try it today in the evening and will give you feedback.

    Best Regards
    NoRulez

  8. #8
    Join Date
    Apr 2008
    Posts
    196
    Thanked 8 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    1

    Default Re: Problem compiling PostgreSQL driver with Qt-SDK 2010.02.01

    OK, i've tried it and now I get the following error:
    Qt Code:
    1. Creating library file: c:\Qt\2010.02.1\qt\plugins\sqldrivers\libqsqlpsqld4.a
    2. tmp/obj/debug_shared/qsql_psql.o: In function `qMakeError':
    3. C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:176: undefined reference to `PQerrorMessage'
    4. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:186: undefined reference to `PQresultStatus'
    5. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:190: undefined reference to `PQntuples'
    6. tmp/obj/debug_shared/qsql_psql.o: In function `qDeallocatePreparedStmt':
    7. C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:254: undefined reference to `PQexec'
    8. C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:256: undefined reference to `PQresultStatus'
    9. C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:257: undefined reference to `PQerrorMessage'
    10. C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:258: undefined reference to `PQclear'
    11. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:288: undefined reference to `PQclear'
    12. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:316: undefined reference to `PQntuples'
    13. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:321: undefined reference to `PQnfields'
    14. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:325: undefined reference to `PQftype'
    15. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:327: undefined reference to `PQgetvalue'
    16. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:328: undefined reference to `PQgetisnull'
    17. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:407: undefined reference to `PQunescapeBytea'
    18. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:421: undefined reference to `PQgetvalue'
    19. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:422: undefined reference to `PQgetisnull'
    20. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:434: undefined reference to `PQexec'
    21. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:445: undefined reference to `PQcmdTuples'
    22. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:451: undefined reference to `PQoidValue'
    23. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:464: undefined reference to `PQnfields'
    24. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:468: undefined reference to `PQfname'
    25. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:470: undefined reference to `PQfname'
    26. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:471: undefined reference to `PQftype'
    27. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:472: undefined reference to `PQfsize'
    28. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:473: undefined reference to `PQfmod'
    29. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:481: undefined reference to `PQftype'
    30. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:567: undefined reference to `PQexec'
    31. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:569: undefined reference to `PQresultStatus'
    32. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:572: undefined reference to `PQclear'
    33. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:577: undefined reference to `PQclear'
    34. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:598: undefined reference to `PQexec'
    35. tmp/obj/debug_shared/qsql_psql.o: In function `setEncodingUtf8':
    36. C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:607: undefined reference to `PQexec'
    37. C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:608: undefined reference to `PQresultStatus'
    38. C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:609: undefined reference to `PQclear'
    39. tmp/obj/debug_shared/qsql_psql.o: In function `setDatestyle':
    40. C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:615: undefined reference to `PQexec'
    41. C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:616: undefined reference to `PQresultStatus'
    42. C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:618: undefined reference to `PQerrorMessage'
    43. C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:619: undefined reference to `PQclear'
    44. tmp/obj/debug_shared/qsql_psql.o: In function `getPSQLVersion':
    45. C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:625: undefined reference to `PQexec'
    46. C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:626: undefined reference to `PQresultStatus'
    47. C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:628: undefined reference to `PQgetvalue'
    48. C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:669: undefined reference to `PQclear'
    49. tmp/obj/debug_shared/qsql_psql.o: In function `~QPSQLDriver':
    50. C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:703: undefined reference to `PQfinish'
    51. C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:703: undefined reference to `PQfinish'
    52. C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:703: undefined reference to `PQfinish'
    53. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:780: undefined reference to `PQconnectdb'
    54. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:781: undefined reference to `PQstatus'
    55. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:784: undefined reference to `PQfinish'
    56. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:810: undefined reference to `PQfinish'
    57. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:828: undefined reference to `PQexec'
    58. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:829: undefined reference to `PQresultStatus'
    59. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:830: undefined reference to `PQclear'
    60. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:835: undefined reference to `PQclear'
    61. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:845: undefined reference to `PQexec'
    62. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:1247: undefined reference to `PQresultStatus'
    63. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:1279: undefined reference to `PQexec'
    64. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:1279: undefined reference to `PQresultStatus'
    65. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:1305: undefined reference to `PQconsumeInput'
    66. tmp/obj/debug_shared/qsql_psql.o:C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:1308: undefined reference to `PQnotifies'
    67. tmp/obj/debug_shared/qsql_psql.o: In function `Z10qPQfreememPv':
    68. C:\Qt\2010.02.1\qt\src\plugins\sqldrivers\psql/../../../sql/drivers/psql/qsql_psql.cpp:118: undefined reference to `PQfreemem'
    69. collect2: ld returned 1 exit status
    70. mingw32-make[1]: *** [..\..\..\..\plugins\sqldrivers\qsqlpsqld4.dll] Error 1
    71. mingw32-make[1]: Leaving directory `C:/Qt/2010.02.1/qt/src/plugins/sqldrivers/psql'
    72. mingw32-make: *** [debug-all] Error 2
    To copy to clipboard, switch view to plain text mode 

    Best Regards
    NoRulez

  9. #9
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Problem compiling PostgreSQL driver with Qt-SDK 2010.02.01

    okay, do you have an libpq.a in your C:\Databases\PostgreSQL\8.4\lib?

  10. #10
    Join Date
    Apr 2008
    Posts
    196
    Thanked 8 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    1

    Default Re: Problem compiling PostgreSQL driver with Qt-SDK 2010.02.01

    yes, i used reimp und dlltool for this

  11. #11
    Join Date
    Apr 2008
    Posts
    196
    Thanked 8 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    1

    Default Re: Problem compiling PostgreSQL driver with Qt-SDK 2010.02.01

    Sorry for pushing.

    The problem still exists, did anybody know an other way

    Best Regards
    NoRulez

Similar Threads

  1. Problem with compiling Qt 4.6 via MSVC 2010 Beta2 (win32-msvc specs)
    By Erik-Moscow in forum Installation and Deployment
    Replies: 2
    Last Post: 17th December 2009, 18:44
  2. Problem compiling QDB2 SQL driver
    By vieraci in forum Installation and Deployment
    Replies: 7
    Last Post: 18th November 2009, 22:04
  3. PostgreSQL driver
    By clusty in forum Qt Programming
    Replies: 1
    Last Post: 21st August 2008, 00:55
  4. Problem compiling ibase driver
    By SteM in forum Installation and Deployment
    Replies: 12
    Last Post: 24th September 2007, 22:26
  5. QT4 and Postgresql driver
    By alphaqt in forum Installation and Deployment
    Replies: 6
    Last Post: 27th February 2006, 15:50

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
  •  
Qt is a trademark of The Qt Company.