Andrew Dunstan wrote:
Recent changes to interfaces/libpg/fe-connect.c have broken MSVC builds, which I am reliably informed are definitely still required - at least some uses of libpq.dll made with gcc apparently cause the resulting builds or applications to blow up.
The trouble seems to come from these 2 lines:
+ #define _WIN32_IE 0x0400 + #include <shlobj.h>
First, on MSVC, _WIN32_IE is already defined at that point. If you get around that then processing the include file causes errors.
I am making some more tests and will post more details shortly - problem first noticed by TJ Doesn'tWantToMentionHisSurname.
MinGW builds appear to be fine, though.
Here is the make output:
Microsoft (R) Program Maintenance Utility Version 7.10.3077 Copyright (C) Microsoft Corporation. All rights reserved.
cd include if not exist pg_config.h copy pg_config.h.win32 pg_config.h cd .. cd interfaces\libpq nmake /f win32.mak
Microsoft (R) Program Maintenance Utility Version 7.10.3077 Copyright (C) Microsoft Corporation. All rights reserved.
Building the Win32 static library...
cl.exe @C:\DOCUME~1\adunstan\LOCALS~1\Temp\nm11E0.tmp
getaddrinfo.c
cl.exe @C:\DOCUME~1\adunstan\LOCALS~1\Temp\nm11E1.tmp
pgstrcasecmp.c
cl.exe @C:\DOCUME~1\adunstan\LOCALS~1\Temp\nm11E2.tmp
thread.c
cl.exe @C:\DOCUME~1\adunstan\LOCALS~1\Temp\nm11E3.tmp
inet_aton.c
cl.exe @C:\DOCUME~1\adunstan\LOCALS~1\Temp\nm11E4.tmp
crypt.c
cl.exe @C:\DOCUME~1\adunstan\LOCALS~1\Temp\nm11E5.tmp
noblock.c
cl.exe @C:\DOCUME~1\adunstan\LOCALS~1\Temp\nm11E6.tmp
md5.c
cl.exe @C:\DOCUME~1\adunstan\LOCALS~1\Temp\nm11E7.tmp
ip.c
cl.exe @C:\DOCUME~1\adunstan\LOCALS~1\Temp\nm11E8.tmp
wchar.c
cl.exe @C:\DOCUME~1\adunstan\LOCALS~1\Temp\nm11E9.tmp
encnames.c
cl.exe @C:\DOCUME~1\adunstan\LOCALS~1\Temp\nm11EA.tmp
win32.c
fe-auth.c
fe-protocol2.c
fe-protocol3.c
fe-connect.c
fe-connect.c(38) : warning C4005: '_WIN32_IE' : macro redefinition
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\PrSht.h(18) : see previous definition of '_WIN32_IE'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\CommCtrl.h(1175) : error C2143: syntax error : missing ';' before '*'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\CommCtrl.h(2268) : error C2371: 'near' : redefinition; different basic types
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\CommCtrl.h(1175) : see declaration of 'near'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\CommCtrl.h(2268) : error C2143: syntax error : missing ';' before '*'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\CommCtrl.h(2284) : error C2371: 'near' : redefinition; different basic types
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\CommCtrl.h(1175) : see declaration of 'near'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\CommCtrl.h(2284) : error C2143: syntax error : missing ';' before '*'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ShObjIdl.h(3687) : error C2061: syntax error : identifier 'LPTBBUTTONSB'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ShObjIdl.h(3687) : error C2059: syntax error : ';'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ShObjIdl.h(3849) : error C2146: syntax error : missing ')' before identifier 'lpButtons'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ShObjIdl.h(3849) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ShObjIdl.h(3849) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ShObjIdl.h(3849) : error C2143: syntax error : missing ')' before 'identifier'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ShObjIdl.h(3849) : error C2081: 'LPTBBUTTONSB' : name in formal parameter list illegal
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ShObjIdl.h(3849) : error C2146: syntax error : missing ';' before identifier 'lpButtons'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ShObjIdl.h(3849) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ShObjIdl.h(3849) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ShObjIdl.h(3849) : error C2143: syntax error : missing ';' before 'identifier'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ShObjIdl.h(3849) : error C2061: syntax error : identifier 'lpButtons'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ShObjIdl.h(3851) : error C2059: syntax error : ')'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ShObjIdl.h(3854) : error C2059: syntax error : '}'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ShObjIdl.h(4086) : error C2146: syntax error : missing ')' before identifier 'lpButtons'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ShObjIdl.h(4086) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ShObjIdl.h(4086) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ShObjIdl.h(4086) : error C2143: syntax error : missing ')' before 'identifier'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ShObjIdl.h(4086) : error C2081: 'LPTBBUTTONSB' : name in formal parameter list illegal
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ShObjIdl.h(4086) : error C2061: syntax error : identifier 'lpButtons'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ShObjIdl.h(4086) : error C2059: syntax error : ';'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ShObjIdl.h(4086) : error C2059: syntax error : ','
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\ShObjIdl.h(4088) : error C2059: syntax error : ')'
fe-exec.c
fe-lobj.c
fe-misc.c
fe-print.c
fe-secure.c
pqexpbuffer.c
pqsignal.c
pthread-win32.c
NMAKE : fatal error U1077: 'cl.exe' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio .NET 2003\VC7\BIN\nmake.exe"' : return code '0x2'
Stop.
---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faqs/FAQ.html