Results 1 to 2 of 2

Thread: Problems building Postgres 9.1 QPSQL Driver under VISTA and Qt-SDK 4.8.1

  1. #1
    Join Date
    May 2009
    Location
    Vienna
    Posts
    91
    Thanks
    18
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Problems building Postgres 9.1 QPSQL Driver under VISTA and Qt-SDK 4.8.1

    Hello,
    in my App the QPSQL driver is not loaded..

    Qt Code:
    1. QSqlDatabase: QPSQL driver not loaded
    2. QSqlDatabase: available drivers: QSQLITE QODBC3 QODBC
    To copy to clipboard, switch view to plain text mode 
    So i need to build it.
    I'm using msvc2010 and the proper toolchain: C:\QtSDK\Desktop\Qt\4.8.1\msvc2010\bin

    I've read many posts and found the wiki:
    http://www.qtcentre.org/wiki/index.p...or_QtSDK_Users

    I've installed the missing sources, put the paths as described in the wiki, did:

    Qt Code:
    1. cd C:\QtSDK\QtSources\4.8.1\src\plugins\sqldrivers\psql
    2. qmake "INCLUDEPATH+=C:\\Program Files\\PostgreSQL\\9.1\\include" "LIBS+= C:\\Program Files\\PostgreSQL\\9.1\\lib\\libpg.lib" psql.pro
    3. nmake
    To copy to clipboard, switch view to plain text mode 

    the result of nmake was:
    Qt Code:
    1. c:\QtSDK\QtSources\4.8.1\src\plugins\sqldrivers\psql>nmake
    2.  
    3. Microsoft (R) Program Maintenance Utility, Version 10.00.30319.01
    4. Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.
    5.  
    6. "C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\nmake.exe" -f Makefile.Debug
    7.  
    8. Microsoft (R) Program Maintenance Utility, Version 10.00.30319.01
    9. Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.
    10.  
    11. C:\QtSDK\Desktop\Qt\4.8.1\msvc2010\bin\moc.exe -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCI
    12. I -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SU
    13. PPORT -I"c:\QtSDK\Desktop\Qt\4.8.1\msvc2010\include\QtCore" -I"c:\QtSDK\Desktop\Qt\4.8.1\msvc2010\include\QtSql" -I"c:\QtSDK\Desktop\Qt\4.8.
    14. 1\msvc2010\include" -I"c:\Program" -I"Files\PostgreSQL\9.1\include" -I"c:\QtSDK\QtSources\4.8.1" -I"..\..\..\sql\drivers\psql" -I"." -I"c:\P
    15. rogram Files\PostgreSQL\9.1\include" -I"c:\Program Files\PostgreSQL\9.1\lib" -I"c:\Program Files\PostgreSQL\psqlODBC\0901\bin" -I"c:\QtSDK\D
    16. esktop\Qt\4.8.1\msvc2010\include\ActiveQt" -I"debug" -I"c:\QtSDK\Desktop\Qt\4.8.1\msvc2010\mkspecs\win32-msvc2010" -D_MSC_VER=1600 -DWIN32 .
    17. .\..\..\sql\drivers\psql\qsql_psql.h -o debug\moc_qsql_psql.cpp
    18. rc -D_DEBUG -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB
    19. -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -fo debug\qsqlpsqld_resource.
    20. res qsqlpsqld_resource.rc
    21. Der Befehl "rc" ist entweder falsch geschrieben oder
    22. konnte nicht gefunden werden.
    23. NMAKE : fatal error U1077: "rc": Rückgabe-Code "0x1"
    24. Stop.
    25. NMAKE : fatal error U1077: ""C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\nmake.exe"": Rückgabe-Code "0x2"
    26. Stop.
    27.  
    28. c:\QtSDK\QtSources\4.8.1\src\plugins\sqldrivers\psql>
    To copy to clipboard, switch view to plain text mode 


    so:
    -fo debug\qsqlpsqld_resource.res qsqlpsqld_resource.rc
    the command "rc" is either wrong or could not be found


    I've looked over the files and google but did not find anything helpful.
    Any advices would be appreciated.

    thanx in advance,
    Astronomy

  2. #2
    Join Date
    May 2009
    Location
    Vienna
    Posts
    91
    Thanks
    18
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problems building Postgres 9.1 QPSQL Driver under VISTA and Qt-SDK 4.8.1

    The two files which were produced by qmake contain:

    qsqlpsql_resource.rc

    Qt Code:
    1. # if defined(UNDER_CE)
    2. # include <winbase.h>
    3. # else
    4. # include <winver.h>
    5. # endif
    6.  
    7. VS_VERSION_INFO VERSIONINFO
    8. FILEVERSION 4,8,1,0
    9. PRODUCTVERSION 4,8,1,0
    10. FILEFLAGSMASK 0x3fL
    11. #ifdef _DEBUG
    12. FILEFLAGS VS_FF_DEBUG
    13. #else
    14. FILEFLAGS 0x0L
    15. #endif
    16. FILEOS VOS__WINDOWS32
    17. FILETYPE VFT_DLL
    18. FILESUBTYPE 0x0L
    19. BEGIN
    20. BLOCK "StringFileInfo"
    21. BEGIN
    22. BLOCK "040904B0"
    23. BEGIN
    24. VALUE "CompanyName", "Nokia Corporation and/or its subsidiary(-ies)\0"
    25. VALUE "FileDescription", "C++ application development framework.\0"
    26. VALUE "FileVersion", "4.8.1.0\0"
    27. VALUE "LegalCopyright", "Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).\0"
    28. VALUE "OriginalFilename", "qsqlpsql4.dll\0"
    29. VALUE "ProductName", "Qt4\0"
    30. END
    31. END
    32. BLOCK "VarFileInfo"
    33. BEGIN
    34. VALUE "Translation", 0x409, 1200
    35. END
    36. END
    37. /* End of Version info */
    To copy to clipboard, switch view to plain text mode 

    qsqlpsqld_resource.rc
    Qt Code:
    1. # if defined(UNDER_CE)
    2. # include <winbase.h>
    3. # else
    4. # include <winver.h>
    5. # endif
    6.  
    7. VS_VERSION_INFO VERSIONINFO
    8. FILEVERSION 4,8,1,0
    9. PRODUCTVERSION 4,8,1,0
    10. FILEFLAGSMASK 0x3fL
    11. #ifdef _DEBUG
    12. FILEFLAGS VS_FF_DEBUG
    13. #else
    14. FILEFLAGS 0x0L
    15. #endif
    16. FILEOS VOS__WINDOWS32
    17. FILETYPE VFT_DLL
    18. FILESUBTYPE 0x0L
    19. BEGIN
    20. BLOCK "StringFileInfo"
    21. BEGIN
    22. BLOCK "040904B0"
    23. BEGIN
    24. VALUE "CompanyName", "Nokia Corporation and/or its subsidiary(-ies)\0"
    25. VALUE "FileDescription", "C++ application development framework.\0"
    26. VALUE "FileVersion", "4.8.1.0\0"
    27. VALUE "LegalCopyright", "Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).\0"
    28. VALUE "OriginalFilename", "qsqlpsqld4.dll\0"
    29. VALUE "ProductName", "Qt4\0"
    30. END
    31. END
    32. BLOCK "VarFileInfo"
    33. BEGIN
    34. VALUE "Translation", 0x409, 1200
    35. END
    36. END
    37. /* End of Version info */
    To copy to clipboard, switch view to plain text mode 

    regards A.


    Added after 5 minutes:


    Mhhh oh, maybe the output of nmake row:17,18,19 is meant.. rc -D_DEBUG and so on..

    Qt Code:
    1. .\..\..\sql\drivers\psql\qsql_psql.h -o debug\moc_qsql_psql.cpp
    2. rc -D_DEBUG -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB
    3. -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -fo debug\qsqlpsqld_resource.
    To copy to clipboard, switch view to plain text mode 

    EDITED:
    the correct translation of rc not found would be:
    Qt Code:
    1. 'rc' is not recognized as an internal or external command,
    2. operable program or batch file.
    3. NMAKE : fatal error U1077: 'rc' : return code '0x1'
    4. Stop.
    To copy to clipboard, switch view to plain text mode 

    rc seems to be:
    The Microsoft Windows Resource Compiler (RC) is a tool used in building Windows-based applications. This overview describes how to create a resource-definition (script) file, how to compile your application's resources, and how to add compiled resources to your application.
    This tool is available in Visual Studio and the Microsoft Windows Software Development Kit (SDK).
    "rc.exe tool is provided by the Windows SDK."
    http://superuser.com/questions/11986...ws-sdk-missing

    so i migth only have to make the path to it visible..

    The two files which were produced by qmake contain:

    qsqlpsql_resource.rc

    Qt Code:
    1. # if defined(UNDER_CE)
    2. # include <winbase.h>
    3. # else
    4. # include <winver.h>
    5. # endif
    6.  
    7. VS_VERSION_INFO VERSIONINFO
    8. FILEVERSION 4,8,1,0
    9. PRODUCTVERSION 4,8,1,0
    10. FILEFLAGSMASK 0x3fL
    11. #ifdef _DEBUG
    12. FILEFLAGS VS_FF_DEBUG
    13. #else
    14. FILEFLAGS 0x0L
    15. #endif
    16. FILEOS VOS__WINDOWS32
    17. FILETYPE VFT_DLL
    18. FILESUBTYPE 0x0L
    19. BEGIN
    20. BLOCK "StringFileInfo"
    21. BEGIN
    22. BLOCK "040904B0"
    23. BEGIN
    24. VALUE "CompanyName", "Nokia Corporation and/or its subsidiary(-ies)\0"
    25. VALUE "FileDescription", "C++ application development framework.\0"
    26. VALUE "FileVersion", "4.8.1.0\0"
    27. VALUE "LegalCopyright", "Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).\0"
    28. VALUE "OriginalFilename", "qsqlpsql4.dll\0"
    29. VALUE "ProductName", "Qt4\0"
    30. END
    31. END
    32. BLOCK "VarFileInfo"
    33. BEGIN
    34. VALUE "Translation", 0x409, 1200
    35. END
    36. END
    37. /* End of Version info */
    To copy to clipboard, switch view to plain text mode 

    qsqlpsqld_resource.rc
    Qt Code:
    1. # if defined(UNDER_CE)
    2. # include <winbase.h>
    3. # else
    4. # include <winver.h>
    5. # endif
    6.  
    7. VS_VERSION_INFO VERSIONINFO
    8. FILEVERSION 4,8,1,0
    9. PRODUCTVERSION 4,8,1,0
    10. FILEFLAGSMASK 0x3fL
    11. #ifdef _DEBUG
    12. FILEFLAGS VS_FF_DEBUG
    13. #else
    14. FILEFLAGS 0x0L
    15. #endif
    16. FILEOS VOS__WINDOWS32
    17. FILETYPE VFT_DLL
    18. FILESUBTYPE 0x0L
    19. BEGIN
    20. BLOCK "StringFileInfo"
    21. BEGIN
    22. BLOCK "040904B0"
    23. BEGIN
    24. VALUE "CompanyName", "Nokia Corporation and/or its subsidiary(-ies)\0"
    25. VALUE "FileDescription", "C++ application development framework.\0"
    26. VALUE "FileVersion", "4.8.1.0\0"
    27. VALUE "LegalCopyright", "Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).\0"
    28. VALUE "OriginalFilename", "qsqlpsqld4.dll\0"
    29. VALUE "ProductName", "Qt4\0"
    30. END
    31. END
    32. BLOCK "VarFileInfo"
    33. BEGIN
    34. VALUE "Translation", 0x409, 1200
    35. END
    36. END
    37. /* End of Version info */
    To copy to clipboard, switch view to plain text mode 

    regards A.


    Added after 5 minutes:


    Mhhh oh, maybe the output of nmake row:17,18,19 is meant.. rc -D_DEBUG and so on..

    Qt Code:
    1. .\..\..\sql\drivers\psql\qsql_psql.h -o debug\moc_qsql_psql.cpp
    2. rc -D_DEBUG -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB
    3. -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -fo debug\qsqlpsqld_resource.
    To copy to clipboard, switch view to plain text mode 

    EDITED:
    the correct translation of rc not found would be:
    Qt Code:
    1. 'rc' is not recognized as an internal or external command,
    2. operable program or batch file.
    3. NMAKE : fatal error U1077: 'rc' : return code '0x1'
    4. Stop.
    To copy to clipboard, switch view to plain text mode 

    rc seems to be:
    The Microsoft Windows Resource Compiler (RC) is a tool used in building Windows-based applications. This overview describes how to create a resource-definition (script) file, how to compile your application's resources, and how to add compiled resources to your application.
    This tool is available in Visual Studio and the Microsoft Windows Software Development Kit (SDK).
    "rc.exe tool is provided by the Windows SDK."
    http://superuser.com/questions/11986...ws-sdk-missing

    so i migth only have to make the path to it visible..


    Added after 15 minutes:


    OK, (added to qmake "CONFIG+=release") and making the path to the SDK C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin" visible to the VISTA environment PATH-variable, did the trick with the missing rc command.

    it has now another problem..
    qsqlpsql_resource.rc(4) : fatal error RC1015: cannot open include file 'winver.h'.
    NMAKE : fatal error U1077: ""C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\rc.EXE"": Rückgabe-Code "0x1"
    Stop.
    NMAKE : fatal error U1077: ""C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\nmake.exe"": Rückgabe-Code "0x2"
    Stop.

    nmake:
    Qt Code:
    1. Microsoft Windows [Version 6.0.6002]
    2. Copyright (c) 2006 Microsoft Corporation. Alle Rechte vorbehalten.
    3.  
    4. C:\Users\User> cd C:\QtSDK\QtSources\4.8.1\src\plugins\sqldrivers\psql
    5.  
    6. C:\QtSDK\QtSources\4.8.1\src\plugins\sqldrivers\psql>qmake "CONFIG+=release" "INCLUDEPATH+=C:\\Program Files\\Microsoft SDKs\\Windows\\v7.0
    7. A\\bin" "INCLUDEPATH+=C:\\Program Files\\PostgreSQL\\9.1\\include" "LIBS+= C:\\Program Files\\PostgreSQL\\9.1\\lib\\libpg.lib" psql.pro
    8.  
    9. C:\QtSDK\QtSources\4.8.1\src\plugins\sqldrivers\psql>nmake
    10.  
    11. Microsoft (R) Program Maintenance Utility, Version 10.00.30319.01
    12. Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.
    13.  
    14. "C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\nmake.exe" -f Makefile.Release
    15.  
    16. Microsoft (R) Program Maintenance Utility, Version 10.00.30319.01
    17. Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.
    18.  
    19. rc -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQ
    20. L_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -fo release\qsqlpsql_resource.res qsqlpsql_resource.rc
    21. Microsoft (R) Windows (R) Resource Compiler Version 6.1.7600.16385
    22. Copyright (C) Microsoft Corporation. All rights reserved.
    23.  
    24. qsqlpsql_resource.rc(4) : fatal error RC1015: cannot open include file 'winver.h'.
    25. NMAKE : fatal error U1077: ""C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\rc.EXE"": Rückgabe-Code "0x1"
    26. Stop.
    27. NMAKE : fatal error U1077: ""C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\nmake.exe"": Rückgabe-Code "0x2"
    28. Stop.
    29.  
    30. C:\QtSDK\QtSources\4.8.1\src\plugins\sqldrivers\psql>
    To copy to clipboard, switch view to plain text mode 

    EDIT:
    Adding the path to the file to qmake still did not do the trick, although the file "winver.h" is in the include directory present?
    Qt Code:
    1. qmake "CONFIG+=release" "INCLUDEPATH+=C:\\Program Files\\Microsoft SDKs\\Windows\\v7.0A\\Include" "INCLUDEPATH+=C:\\Program Files\\Microsoft SDKs\\Windows\\v7.0A\\bin" "INCLUDEPATH+=C:\\Program Files\\PostgreSQL\\9.1\\include" "LIBS+= C:\\Program Files\\PostgreSQL\\9.1\\lib\\libpg.lib" psql.pro
    To copy to clipboard, switch view to plain text mode 
    Last edited by Astronomy; 25th July 2012 at 15:14.

Similar Threads

  1. QPSQL + QT4 (Postgresql driver bug)
    By l2succes in forum Qt Programming
    Replies: 8
    Last Post: 12th March 2011, 23:52
  2. QPSQL driver not loaded
    By drave in forum Newbie
    Replies: 4
    Last Post: 4th May 2010, 13:11
  3. QPSQL - Driver Not Loaded (WIN XP)
    By db in forum Qt Programming
    Replies: 8
    Last Post: 14th September 2009, 01:48
  4. QPSQL driver in windows
    By brevleq in forum Installation and Deployment
    Replies: 31
    Last Post: 14th December 2007, 12:57
  5. nmake problems while building mysql driver
    By MarkoSan in forum Installation and Deployment
    Replies: 27
    Last Post: 25th May 2007, 12: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.