Re: Home dir changes have broken MSVC builds

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Magnus Hagander <mha(at)sollentuna(dot)net>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, tjtoocool(at)phreaker(dot)net
Subject: Re: Home dir changes have broken MSVC builds
Date: 2005-01-09 21:12:38
Message-ID: 41E19E46.6020104@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Magnus Hagander wrote:

>>The error appears to be on line that uses NEAR and complains about it
>>... I see that the MinGW windef.h defines NEAR as empty, while
>>the MSVC
>>windef.h defines it as "near". Don't know if that makes a difference.
>>
>>
>
>Some reading up on MSDN gives this:
>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore9
>8/html/_core_removing_near_and_far_type_declarations.asp
>
>>From what I can tell, NEAR is defined to near, which is then defined to
>blank in my windef.h (from the platform SDK included in VS2003)
>
>Could it be that we need to include windef.h explicitly, before we
>include this one? Worth a try.
>
>
>

I tried but it didn't work. However, I made some progress with changing
the section to look like this:

#ifdef WIN32
#include "win32.h"
#ifndef _WIN32_IE
#define _WIN32_IE 0x0400
#endif
#ifdef near
#undef near
#endif
#define near
#include <shlobj.h>
#else

Now the make produces this:

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\nm1248.tmp
getaddrinfo.c
cl.exe @C:\DOCUME~1\adunstan\LOCALS~1\Temp\nm1249.tmp
pgstrcasecmp.c
cl.exe @C:\DOCUME~1\adunstan\LOCALS~1\Temp\nm124A.tmp
thread.c
cl.exe @C:\DOCUME~1\adunstan\LOCALS~1\Temp\nm124B.tmp
inet_aton.c
cl.exe @C:\DOCUME~1\adunstan\LOCALS~1\Temp\nm124C.tmp
crypt.c
cl.exe @C:\DOCUME~1\adunstan\LOCALS~1\Temp\nm124D.tmp
noblock.c
cl.exe @C:\DOCUME~1\adunstan\LOCALS~1\Temp\nm124E.tmp
md5.c
cl.exe @C:\DOCUME~1\adunstan\LOCALS~1\Temp\nm124F.tmp
ip.c
cl.exe @C:\DOCUME~1\adunstan\LOCALS~1\Temp\nm1250.tmp
wchar.c
cl.exe @C:\DOCUME~1\adunstan\LOCALS~1\Temp\nm1251.tmp
encnames.c
cl.exe @C:\DOCUME~1\adunstan\LOCALS~1\Temp\nm1252.tmp
win32.c
fe-auth.c
fe-protocol2.c
fe-protocol3.c
fe-connect.c
fe-exec.c
fe-lobj.c
fe-misc.c
fe-print.c
fe-secure.c
pqexpbuffer.c
pqsignal.c
pthread-win32.c
link.exe -lib @C:\DOCUME~1\adunstan\LOCALS~1\Temp\nm1253.tmp
cl.exe @C:\DOCUME~1\adunstan\LOCALS~1\Temp\nm1254.tmp
libpqdll.c
rc.exe /l 0x409 /fo".\Release\libpq.res" libpq.rc
link.exe @C:\DOCUME~1\adunstan\LOCALS~1\Temp\nm1255.tmp
libpqdll.def(3) : warning LNK4017: DESCRIPTION statement not supported
for the target platform; ignored
Creating library .\Release\libpqdll.lib and object .\Release\libpqdll.exp
libpq.lib(fe-connect.obj) : error LNK2019: unresolved external symbol
__imp__SHGetSpecialFolderPathA(at)16 referenced in function _pqGetHomeDirectory
.\Release\libpq.dll : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: 'link.exe' : return code '0x460'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio
.NET 2003\VC7\BIN\nmake.exe"' : return code '0x2'
Stop.

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-01-09 21:21:54 Re: Home dir changes have broken MSVC builds
Previous Message Magnus Hagander 2005-01-09 19:41:49 Re: Home dir changes have broken MSVC builds