pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #6203: Building libpq with Visual Studio 9.0 error
2+ messages / 2 participants
[nested] [flat]

* BUG #6203: Building libpq with Visual Studio 9.0 error
@ 2011-09-14 05:23 Steve <argonaut@yandex.ru>
  2011-09-14 15:04 ` Re: BUG #6203: Building libpq with Visual Studio 9.0 error Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Steve @ 2011-09-14 05:23 UTC (permalink / raw)
  To: pgsql-bugs


The following bug has been logged online:

Bug reference:      6203
Logged by:          Steve
Email address:      argonaut@yandex.ru
PostgreSQL version: 9.1.0
Operating system:   Windows XP SP3 x32
Description:        Building libpq with Visual Studio 9.0 error
Details: 

When I'm trying to build libpq client library
with Visual Studio 9.0 (as described in documentation
section 16.2, I mean executing "nmake /f win32.mak" in
command string), linking step gives me this error:

"link.exe @C:\DOCUME~1\Admin\LOCALS~1\Temp\nm36.tmp
 Creating library .\Release\libpqdll.lib and object
     .\Release\libpqdll.exp
 libpq.lib(chklocale.obj) : error LNK2019: unresolved
      external symbol _pgwin32_setlocale referenced in
      function _pg_get_encoding_from_locale
 .\Release\libpq.dll : fatal error LNK1120: 1 unresolved
       externals"



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #6203: Building libpq with Visual Studio 9.0 error
  2011-09-14 05:23 BUG #6203: Building libpq with Visual Studio 9.0 error Steve <argonaut@yandex.ru>
@ 2011-09-14 15:04 ` Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Heikki Linnakangas @ 2011-09-14 15:04 UTC (permalink / raw)
  To: Steve <argonaut@yandex.ru>; +Cc: pgsql-bugs

On 14.09.2011 08:23, Steve wrote:
>
> The following bug has been logged online:
>
> Bug reference:      6203
> Logged by:          Steve
> Email address:      argonaut@yandex.ru
> PostgreSQL version: 9.1.0
> Operating system:   Windows XP SP3 x32
> Description:        Building libpq with Visual Studio 9.0 error
> Details:
>
> When I'm trying to build libpq client library
> with Visual Studio 9.0 (as described in documentation
> section 16.2, I mean executing "nmake /f win32.mak" in
> command string), linking step gives me this error:
>
> "link.exe @C:\DOCUME~1\Admin\LOCALS~1\Temp\nm36.tmp
>   Creating library .\Release\libpqdll.lib and object
>       .\Release\libpqdll.exp
>   libpq.lib(chklocale.obj) : error LNK2019: unresolved
>        external symbol _pgwin32_setlocale referenced in
>        function _pg_get_encoding_from_locale
>   .\Release\libpq.dll : fatal error LNK1120: 1 unresolved
>         externals"

libpq needs to link in win32setlocale.c, but that was neglected in that 
makefile used for stand-alone libpq builds. To be honest, I didn't even 
know you can build libpq that way until now. I just committed a fix for 
that, you can pull the latest sources from the git repository. The patch 
I committed is also attached, if you want to just apply it to your 
current 9.1.0 sources.

Thanks for the report!

-- 
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

Attachments:

fix-libpq-win-build.patch (text/x-diff, 1.6K) download commit 09e98a3e170ecdeb25a0e1afe81bdbeeeaf21f48 Author: Heikki Linnakangas <heikki.linnakangas@iki.fi> Date: Wed Sep 14 17:57:32 2011 +0300 Teach the makefile used to build stand-alone libpq on Windows that libpq needs win32setlocale.c now. The cygwin and MSVC build scripts were changed earlier, but this was neglected. This should fix bug report #6203 by Steve. diff --git a/src/interfaces/libpq/win32.mak b/src/interfaces/libpq/win32.mak index fd778d0..70a741a 100644 --- a/src/interfaces/libpq/win32.mak +++ b/src/interfaces/libpq/win32.mak @@ -87,8 +87,8 @@ CLEAN : -@erase "$(INTDIR)\inet_aton.obj" -@erase "$(INTDIR)\crypt.obj" -@erase "$(INTDIR)\noblock.obj" - -@erase "$(INTDIR)\chklocale.obj" - -@erase "$(INTDIR)\inet_net_ntop.obj" + -@erase "$(INTDIR)\chklocale.obj" + -@erase "$(INTDIR)\inet_net_ntop.obj" -@erase "$(INTDIR)\md5.obj" -@erase "$(INTDIR)\ip.obj" -@erase "$(INTDIR)\fe-auth.obj" @@ -114,6 +114,7 @@ CLEAN : -@erase "$(INTDIR)\pgsleep.obj" -@erase "$(INTDIR)\open.obj" -@erase "$(INTDIR)\win32error.obj" + -@erase "$(INTDIR)\win32setlocale.obj" -@erase "$(OUTDIR)\$(OUTFILENAME).lib" -@erase "$(OUTDIR)\$(OUTFILENAME)dll.lib" -@erase "$(OUTDIR)\libpq.res" @@ -159,6 +160,7 @@ LIB32_OBJS= \ "$(INTDIR)\pgsleep.obj" \ "$(INTDIR)\open.obj" \ "$(INTDIR)\win32error.obj" \ + "$(INTDIR)\win32setlocale.obj" \ "$(INTDIR)\pthread-win32.obj" @@ -330,6 +332,11 @@ LINK32_OBJS= \ $(CPP_PROJ) /I"." ..\..\port\win32error.c << +"$(INTDIR)\win32setlocale.obj" : ..\..\port\win32setlocale.c + $(CPP) @<< + $(CPP_PROJ) /I"." ..\..\port\win32setlocale.c +<< + .c{$(CPP_OBJS)}.obj: $(CPP) $(CPP_PROJ) $<
^ permalink raw reply [nested|flat] 2+ messages in thread


end of thread, other threads:[~2011-09-14 15:04 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-09-14 05:23 BUG #6203: Building libpq with Visual Studio 9.0 error Steve <argonaut@yandex.ru>
2011-09-14 15:04 ` Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox