pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Doc comments form <noreply@postgresql.org>
To: pgsql-docs@lists.postgresql.org
Cc: liambowen@gmail.com
Subject: gettext instructions for Windows seems wrong
Date: Mon, 17 Jan 2022 22:55:38 +0000
Message-ID: <164246013804.31952.4958087335645367498@wrigleys.postgresql.org> (raw)

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/14/install-windows-full.html
Description:

I have to build Postgres on Windows 10. I got everything building from a git
checkout without NLS. I followed the instructions the way I understood them
(possibly incorrectly).

To add NLS support, I read this:
Gettext is required to build with NLS support, and can be downloaded from
http://gnuwin32.sourceforge.net. Note that binaries, dependencies and
developer files are all needed.

So, I went to that site and downloaded the binaries, dependencies, and
developer files as three separate ZIPs. I created a folder,
C:\Users\Documents\Code\libintl and then extracted all three ZIPs into that
directory. In that folder, there end up being directories for: bin, contrib,
include, lib, man, manifest, share. This makes sense to me; all the
extracted files are merged into one coherent directory tree rooted at
C:\Users\Documents\Code\libintl.

The instructions say that I have to edit config.pl (actually, I had to
create it), and I added this line:
$config->{nls} = 'C:\Users\dcbow\Documents\Code\libintl';

Then when I run "build", I get:

fe-misc.obj : error LNK2019: unresolved external symbol
__imp_libintl_dgettext referenced in function libpq_gettext
[c:\Users\dcbow\Documents\Code\postgres\libpq.vcxproj]
fe-misc.obj : error LNK2019: unresolved external symbol
__imp_libintl_dngettext referenced in function libpq_ngettext
[c:\Users\dcbow\Documents\Code\postgres\libpq.vcxproj]
fe-misc.obj : error LNK2019: unresolved external symbol
__imp_libintl_bindtextdomain referenced in function libpq_binddomain
[c:\Users\dcbow\Documents\Code\postgres\libpq.vcxproj]
libpgport.lib(strerror.obj) : error LNK2019: unresolved external symbol
__imp_libintl_gettext referenced in function pg_strerror_r
[c:\Users\dcbow\Documents\Code\postgres\libpq.vcxproj]
libpgport.lib(chklocale.obj) : error LNK2001: unresolved external symbol
__imp_libintl_gettext
[c:\Users\dcbow\Documents\Code\postgres\libpq.vcxproj]
C:\Users\dcbow\Documents\Code\libintl\lib\libintl.lib : warning LNK4272:
library machine type 'x86' conflicts with target machine type 'x64'
[c:\Users\dcbow\Documents\Code\postgres\libpq.vcxproj]
.\Debug\libpq\libpq.dll : fatal error LNK1120: 4 unresolved externals
[c:\Users\dcbow\Documents\Code\postgres\libpq.vcxproj]

Based on the line containing LNK4272, I learned two things here: 1. It seems
like extracting the files that I did in the place that I did and also
setting the line in config.pl that I did all seem right; at least the build
can find the files. 2. It's 32 bit, not 64, which seems to create another
problem. The documentation says: "To use a server-side third party library
such as python or OpenSSL, this library must also be 64-bit. There is no
support for loading a 32-bit library in a 64-bit server. "

I'm trying to build this, rather than use the installer,  in order to find
whatever commit introduced a particular bug in libpq. I downloaded the
binary (ZIP) files from EnterpriseDB at
https://www.enterprisedb.com/download-postgresql-binaries, and they include
libintl-9.dll. In fact, in at least 12.9, 13.5 and 14.1, it's the exact same
binary. But the libintl DLL that's in http://gnuwin32.sourceforge.net/ is
named libintl3.dll and was built 17 years ago.

So, my chief complaint is that the gettext/libintl download that's listed in
the documentation is a creaky antique that, due to API changes and bitness
issues in the given build, will not work. I'm investigating
https://mlocati.github.io/articles/gettext-iconv-windows.html, which are
just more modern builds, or building all of it myself with MSYS2.

Any guidance would be appreciated, as would some sort of update to the docs
that do not have such an outdated dependency reference. Thanks for such
otherwise excellent documentation!


view thread (6+ messages)  latest in thread

Message-ID: <164246013804.31952.4958087335645367498@wrigleys.postgresql.org>
Permalink:  ../164246013804.31952.4958087335645367498@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/164246013804.31952.4958087335645367498@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-docs@lists.postgresql.org, liambowen@gmail.com
  Subject: Re: gettext instructions for Windows seems wrong
  In-Reply-To: <164246013804.31952.4958087335645367498@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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