PDA

View Full Version : Problems building Postgres 9.1 QPSQL Driver under VISTA and Qt-SDK 4.8.1



Astronomy
25th July 2012, 00:11
Hello,
in my App the QPSQL driver is not loaded..


QSqlDatabase: QPSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QODBC3 QODBC

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.php?title=Building_the_Database_Plugins_for_ QtSDK_Users

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


cd C:\QtSDK\QtSources\4.8.1\src\plugins\sqldrivers\ps ql
qmake "INCLUDEPATH+=C:\\Program Files\\PostgreSQL\\9.1\\include" "LIBS+= C:\\Program Files\\PostgreSQL\\9.1\\lib\\libpg.lib" psql.pro
nmake


the result of nmake was:

c:\QtSDK\QtSources\4.8.1\src\plugins\sqldrivers\ps ql>nmake

Microsoft (R) Program Maintenance Utility, Version 10.00.30319.01
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.

"C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\nmake.exe" -f Makefile.Debug

Microsoft (R) Program Maintenance Utility, Version 10.00.30319.01
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.

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
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
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.
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
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
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 .
.\..\..\sql\drivers\psql\qsql_psql.h -o debug\moc_qsql_psql.cpp
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
-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.
res qsqlpsqld_resource.rc
Der Befehl "rc" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
NMAKE : fatal error U1077: "rc": 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.

c:\QtSDK\QtSources\4.8.1\src\plugins\sqldrivers\ps ql>


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

Astronomy
25th July 2012, 15:50
The two files which were produced by qmake contain:

qsqlpsql_resource.rc


# if defined(UNDER_CE)
# include <winbase.h>
# else
# include <winver.h>
# endif

VS_VERSION_INFO VERSIONINFO
FILEVERSION 4,8,1,0
PRODUCTVERSION 4,8,1,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
#else
FILEFLAGS 0x0L
#endif
FILEOS VOS__WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904B0"
BEGIN
VALUE "CompanyName", "Nokia Corporation and/or its subsidiary(-ies)\0"
VALUE "FileDescription", "C++ application development framework.\0"
VALUE "FileVersion", "4.8.1.0\0"
VALUE "LegalCopyright", "Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).\0"
VALUE "OriginalFilename", "qsqlpsql4.dll\0"
VALUE "ProductName", "Qt4\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
/* End of Version info */



qsqlpsqld_resource.rc

# if defined(UNDER_CE)
# include <winbase.h>
# else
# include <winver.h>
# endif

VS_VERSION_INFO VERSIONINFO
FILEVERSION 4,8,1,0
PRODUCTVERSION 4,8,1,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
#else
FILEFLAGS 0x0L
#endif
FILEOS VOS__WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904B0"
BEGIN
VALUE "CompanyName", "Nokia Corporation and/or its subsidiary(-ies)\0"
VALUE "FileDescription", "C++ application development framework.\0"
VALUE "FileVersion", "4.8.1.0\0"
VALUE "LegalCopyright", "Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).\0"
VALUE "OriginalFilename", "qsqlpsqld4.dll\0"
VALUE "ProductName", "Qt4\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
/* End of Version info */



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..


.\..\..\sql\drivers\psql\qsql_psql.h -o debug\moc_qsql_psql.cpp
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
-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.

EDITED:
the correct translation of rc not found would be:

'rc' is not recognized as an internal or external command,
operable program or batch file.
NMAKE : fatal error U1077: 'rc' : return code '0x1'
Stop.

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/119867/rc-exe-from-windows-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


# if defined(UNDER_CE)
# include <winbase.h>
# else
# include <winver.h>
# endif

VS_VERSION_INFO VERSIONINFO
FILEVERSION 4,8,1,0
PRODUCTVERSION 4,8,1,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
#else
FILEFLAGS 0x0L
#endif
FILEOS VOS__WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904B0"
BEGIN
VALUE "CompanyName", "Nokia Corporation and/or its subsidiary(-ies)\0"
VALUE "FileDescription", "C++ application development framework.\0"
VALUE "FileVersion", "4.8.1.0\0"
VALUE "LegalCopyright", "Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).\0"
VALUE "OriginalFilename", "qsqlpsql4.dll\0"
VALUE "ProductName", "Qt4\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
/* End of Version info */



qsqlpsqld_resource.rc

# if defined(UNDER_CE)
# include <winbase.h>
# else
# include <winver.h>
# endif

VS_VERSION_INFO VERSIONINFO
FILEVERSION 4,8,1,0
PRODUCTVERSION 4,8,1,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
#else
FILEFLAGS 0x0L
#endif
FILEOS VOS__WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904B0"
BEGIN
VALUE "CompanyName", "Nokia Corporation and/or its subsidiary(-ies)\0"
VALUE "FileDescription", "C++ application development framework.\0"
VALUE "FileVersion", "4.8.1.0\0"
VALUE "LegalCopyright", "Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).\0"
VALUE "OriginalFilename", "qsqlpsqld4.dll\0"
VALUE "ProductName", "Qt4\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
/* End of Version info */



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..


.\..\..\sql\drivers\psql\qsql_psql.h -o debug\moc_qsql_psql.cpp
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
-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.

EDITED:
the correct translation of rc not found would be:

'rc' is not recognized as an internal or external command,
operable program or batch file.
NMAKE : fatal error U1077: 'rc' : return code '0x1'
Stop.

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/119867/rc-exe-from-windows-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:



Microsoft Windows [Version 6.0.6002]
Copyright (c) 2006 Microsoft Corporation. Alle Rechte vorbehalten.

C:\Users\User> cd C:\QtSDK\QtSources\4.8.1\src\plugins\sqldrivers\ps ql

C:\QtSDK\QtSources\4.8.1\src\plugins\sqldrivers\ps ql>qmake "CONFIG+=release" "INCLUDEPATH+=C:\\Program Files\\Microsoft SDKs\\Windows\\v7.0
A\\bin" "INCLUDEPATH+=C:\\Program Files\\PostgreSQL\\9.1\\include" "LIBS+= C:\\Program Files\\PostgreSQL\\9.1\\lib\\libpg.lib" psql.pro

C:\QtSDK\QtSources\4.8.1\src\plugins\sqldrivers\ps ql>nmake

Microsoft (R) Program Maintenance Utility, Version 10.00.30319.01
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.

"C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\nmake.exe" -f Makefile.Release

Microsoft (R) Program Maintenance Utility, Version 10.00.30319.01
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.

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
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
Microsoft (R) Windows (R) Resource Compiler Version 6.1.7600.16385
Copyright (C) Microsoft Corporation. All rights reserved.

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.

C:\QtSDK\QtSources\4.8.1\src\plugins\sqldrivers\ps ql>


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?

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