Problem linking with Release library
Hi,
A long time ago I built both Debug and Release versions of libpq.
For a while I was working with the Debug version without any issues
Now I tried to build a Release version of my program.
Compilation went fine but during linking I got
[code]
1>libpq.lib(snprintf.obj) : warning LNK4217: locally defined symbol
_sprintf imported in function _fmtptr
1>libpq.lib(dirmod.obj) : error LNK2001: unresolved external symbol
__imp____iob_func
1>libpq.lib(win32error.obj) : error LNK2001: unresolved external
symbol __imp____iob_func
1>libpq.lib(fe-connect.obj) : error LNK2001: unresolved external
symbol __imp____iob_func
1>libpq.lib(snprintf.obj) : error LNK2001: unresolved external symbol
__imp____iob_func
1>libpq.lib(encnames.obj) : error LNK2001: unresolved external symbol
__imp____iob_func
1>libpq.lib(chklocale.obj) : error LNK2001: unresolved external symbol
__imp____iob_func
1>libpq.lib(fe-exec.obj) : error LNK2019: unresolved external symbol
__imp__sscanf referenced in function _pqSaveParameterStatus
1> 33 Warning(s)
1> 8 Error(s)
1>
[/code]
Do I need to rebuild a Release version with some missing parameters?
I'm working with MSVC 2017 for now...
Thank you.
On 5/7/26 11:36 PM, Igor Korot wrote:
Hi,
A long time ago I built both Debug and Release versions of libpq.
Define what distinguishes Debug from Release version.
What version of Postgres are you using for the source?
What OS and version are you building on?
.
Thank you.
--
Adrian Klaver
adrian.klaver@aklaver.com
Hi, Adrian,
On Fri, May 8, 2026 at 7:32 AM Adrian Klaver <adrian.klaver@aklaver.com>
wrote:
On 5/7/26 11:36 PM, Igor Korot wrote:
Hi,
A long time ago I built both Debug and Release versions of libpq.Define what distinguishes Debug from Release version.
Debug - on *nix-like systems it compiles with “-g”. On windows it has
references to the source code.
Release - it’s stripped from the source code references.
What version of Postgres are you using for the source?
What OS and version are you building on?
This is building on Windows 8 with MSVC 2017.
Thank you.
Show quoted text
.
Thank you.
--
Adrian Klaver
adrian.klaver@aklaver.com
On Fri, May 8, 2026 at 11:35 AM Igor Korot <ikorot01@gmail.com> wrote:
[snip]
This is building on Windows 8
Isn't that *years* EOL?
--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!
On 5/8/26 8:34 AM, Igor Korot wrote:
Hi, Adrian,
On Fri, May 8, 2026 at 7:32 AM Adrian Klaver <adrian.klaver@aklaver.com
<mailto:adrian.klaver@aklaver.com>> wrote:On 5/7/26 11:36 PM, Igor Korot wrote:
Hi,
A long time ago I built both Debug and Release versions of libpq.Define what distinguishes Debug from Release version.
Debug - on *nix-like systems it compiles with “-g”. On windows it has
references to the source code.Release - it’s stripped from the source code references.
What are the specific parameters you use to compile in each case?
What version of Postgres are you using for the source?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
?
What OS and version are you building on?
This is building on Windows 8 with MSVC 2017.
Thank you.
.
Thank you.
--
Adrian Klaver
adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
--
Adrian Klaver
adrian.klaver@aklaver.com
On 5/8/26 11:12 AM, Igor Korot wrote:
Hi, Adrian,
On Fri, May 8, 2026 at 11:24 AM Adrian Klaver <adrian.klaver@aklaver.com> wrote:
On 5/8/26 8:34 AM, Igor Korot wrote:
Hi, Adrian,
On Fri, May 8, 2026 at 7:32 AM Adrian Klaver <adrian.klaver@aklaver.com
<mailto:adrian.klaver@aklaver.com>> wrote:On 5/7/26 11:36 PM, Igor Korot wrote:
Hi,
A long time ago I built both Debug and Release versions of libpq.Define what distinguishes Debug from Release version.
Debug - on *nix-like systems it compiles with “-g”. On windows it has
references to the source code.Release - it’s stripped from the source code references.
What are the specific parameters you use to compile in each case?
I don't remember already.
But I THINK I did use default all the way through.
To me it looks like you need to review your tool chain and build process.
Show quoted text
--
Adrian Klaver
adrian.klaver@aklaver.com
Import Notes
Reply to msg id not found: CA+FnnTxS-j2RivcD7Xk6A0UJSy-cR=W_0zyUUw19XZ9dp_7iCQ@mail.gmail.com
Hi, Adrian,
On Fri, May 8, 2026 at 11:24 AM Adrian Klaver <adrian.klaver@aklaver.com> wrote:
On 5/8/26 8:34 AM, Igor Korot wrote:
Hi, Adrian,
On Fri, May 8, 2026 at 7:32 AM Adrian Klaver <adrian.klaver@aklaver.com
<mailto:adrian.klaver@aklaver.com>> wrote:On 5/7/26 11:36 PM, Igor Korot wrote:
Hi,
A long time ago I built both Debug and Release versions of libpq.Define what distinguishes Debug from Release version.
Debug - on *nix-like systems it compiles with “-g”. On windows it has
references to the source code.Release - it’s stripped from the source code references.
What are the specific parameters you use to compile in each case?
I don't remember already.
But I THINK I did use default all the way through.
What version of Postgres are you using for the source?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
?
I will get back on that...
Thank you,
Show quoted text
What OS and version are you building on?
This is building on Windows 8 with MSVC 2017.
Thank you.
.
Thank you.
--
Adrian Klaver
adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>--
Adrian Klaver
adrian.klaver@aklaver.com
Hi, Adrian,
On Fri, May 8, 2026 at 10:46 AM Adrian Klaver <adrian.klaver@aklaver.com> wrote:
On 5/8/26 11:12 AM, Igor Korot wrote:
Hi, Adrian,
On Fri, May 8, 2026 at 11:24 AM Adrian Klaver <adrian.klaver@aklaver.com> wrote:
On 5/8/26 8:34 AM, Igor Korot wrote:
Hi, Adrian,
On Fri, May 8, 2026 at 7:32 AM Adrian Klaver <adrian.klaver@aklaver.com
<mailto:adrian.klaver@aklaver.com>> wrote:On 5/7/26 11:36 PM, Igor Korot wrote:
Hi,
A long time ago I built both Debug and Release versions of libpq.Define what distinguishes Debug from Release version.
Debug - on *nix-like systems it compiles with “-g”. On windows it has
references to the source code.Release - it’s stripped from the source code references.
What are the specific parameters you use to compile in each case?
I don't remember already.
But I THINK I did use default all the way through.To me it looks like you need to review your tool chain and build process.
So I'd like to get back to this.
Turns out I had a very old 9.6 version.
Now I checked and on my Linux box I have 17.4
What I'd like to do is integrate libpq building inside MSVC as a dependency.
Is it possible?
If not - what's the simplest possible way of building the library?
Thank you
Show quoted text
--
Adrian Klaver
adrian.klaver@aklaver.com
Hi, again,
According to Google AI versions prior to 16 can be built
by smply running nmake.
But I really don't want to do that and prefer to stay in par with
Linux version.
Is it possible?
Thank you.
Show quoted text
On Mon, May 11, 2026 at 11:55 PM Igor Korot <ikorot01@gmail.com> wrote:
Hi, Adrian,
On Fri, May 8, 2026 at 10:46 AM Adrian Klaver <adrian.klaver@aklaver.com> wrote:
On 5/8/26 11:12 AM, Igor Korot wrote:
Hi, Adrian,
On Fri, May 8, 2026 at 11:24 AM Adrian Klaver <adrian.klaver@aklaver.com> wrote:
On 5/8/26 8:34 AM, Igor Korot wrote:
Hi, Adrian,
On Fri, May 8, 2026 at 7:32 AM Adrian Klaver <adrian.klaver@aklaver.com
<mailto:adrian.klaver@aklaver.com>> wrote:On 5/7/26 11:36 PM, Igor Korot wrote:
Hi,
A long time ago I built both Debug and Release versions of libpq.Define what distinguishes Debug from Release version.
Debug - on *nix-like systems it compiles with “-g”. On windows it has
references to the source code.Release - it’s stripped from the source code references.
What are the specific parameters you use to compile in each case?
I don't remember already.
But I THINK I did use default all the way through.To me it looks like you need to review your tool chain and build process.
So I'd like to get back to this.
Turns out I had a very old 9.6 version.
Now I checked and on my Linux box I have 17.4
What I'd like to do is integrate libpq building inside MSVC as a dependency.
Is it possible?
If not - what's the simplest possible way of building the library?
Thank you
--
Adrian Klaver
adrian.klaver@aklaver.com
On 5/11/26 11:55 PM, Igor Korot wrote:
Hi, Adrian,
To me it looks like you need to review your tool chain and build process.
So I'd like to get back to this.
Turns out I had a very old 9.6 version.
Now I checked and on my Linux box I have 17.4
What I'd like to do is integrate libpq building inside MSVC as a dependency.
Is it possible?
If not - what's the simplest possible way of building the library?
Have you looked at?:
Thank you
--
Adrian Klaver
adrian.klaver@aklaver.com
--
Adrian Klaver
adrian.klaver@aklaver.com
Hi, Adrian,
On Tue, May 12, 2026 at 9:31 AM Adrian Klaver <adrian.klaver@aklaver.com>
wrote:
On 5/11/26 11:55 PM, Igor Korot wrote:
Hi, Adrian,
To me it looks like you need to review your tool chain and build
process.
So I'd like to get back to this.
Turns out I had a very old 9.6 version.
Now I checked and on my Linux box I have 17.4
What I'd like to do is integrate libpq building inside MSVC as a
dependency.
Is it possible?
If not - what's the simplest possible way of building the library?
Have you looked at?:
No, I didn’t. Thx for the link.
However, if you probably aware, on Windows there is a difference between
Debug and Release builds.
If one links Release library with Debug binary it will run incorrectly if
run at all.
So since I’m right now am building Debug version of my software I need to
build Debug version alone with Release one.
I presume that the download link will give me Release build only?
Thank you.
Show quoted text
Thank you
--
Adrian Klaver
adrian.klaver@aklaver.com--
Adrian Klaver
adrian.klaver@aklaver.com
Adrian,
On Tue, May 12, 2026 at 9:31 AM Adrian Klaver <adrian.klaver@aklaver.com> wrote:
On 5/11/26 11:55 PM, Igor Korot wrote:
Hi, Adrian,
To me it looks like you need to review your tool chain and build process.
So I'd like to get back to this.
Turns out I had a very old 9.6 version.
Now I checked and on my Linux box I have 17.4
What I'd like to do is integrate libpq building inside MSVC as a dependency.
Is it possible?
If not - what's the simplest possible way of building the library?
Have you looked at?:
Also - I'm not interested in downloading the whole server. I already
have it installed on the other machine.
I want libpq Debug and Release versions only as most developers do.
Thank you.
Show quoted text
Thank you
--
Adrian Klaver
adrian.klaver@aklaver.com--
Adrian Klaver
adrian.klaver@aklaver.com
On 5/12/26 2:12 PM, Igor Korot wrote:
Adrian,
Have you looked at?:
Also - I'm not interested in downloading the whole server. I already
have it installed on the other machine.I want libpq Debug and Release versions only as most developers do.
Honestly, at this point I have no idea what your goal is. You will need
to provide a detailed explanation of what you did before that worked and
the conditions that where in place that made it work. Then provide
detailed information on your current conditions and what you want the
result to be.
Thank you.
Thank you
--
Adrian Klaver
adrian.klaver@aklaver.com--
Adrian Klaver
adrian.klaver@aklaver.com
--
Adrian Klaver
adrian.klaver@aklaver.com
Hi, Adrian,
On Tue, May 12, 2026, 5:03 PM Adrian Klaver <adrian.klaver@aklaver.com>
wrote:
On 5/12/26 2:12 PM, Igor Korot wrote:
Adrian,
Have you looked at?:
Also - I'm not interested in downloading the whole server. I already
have it installed on the other machine.I want libpq Debug and Release versions only as most developers do.
Honestly, at this point I have no idea what your goal is. You will need
to provide a detailed explanation of what you did before that worked and
the conditions that where in place that made it work. Then provide
detailed information on your current conditions and what you want the
result to be.
What is want is to have a Debug and Release of libpq on this box.
That's it.
No server and no server utilities.
Just libpq. As shared dynamic library.
In the past what I did was to grab the 9.6 version and build the libpq with
simply run nmake.
I never needed to use Release version as I was working with Debug one.
However couple of days ago I needed to build Release version of my software
and so that's what I tried.
Unfortunately building Release version resulted in the linking error I was
mentioned in the OP.
Debug version was working fine.
Then I realized that there is a mismatch with the versions on my Windows
and Linux machines and as I tried to stay with the same version around
different OSes, I tried to get 17.4.
But unfortunately I was not able to build it easily with just nmake as in
the past because now it requires to install many other unrelated software.
I have no idea why the Release build failed on 9.6. But Debug one worked
for years
So then I thought about creating MSVC project for building libpq as a
dependency. All I need is to produce a basic default build of both Debug
and Release builds of libpq only. No server and no ther software needed.
Prefer to build version 17.4.
I have MSVC 2017 on Windows 8.1. This setup was working fine with libpq
Debug version 9.6
I hope now it's clear
Let me know if it's not.
Thank you.
Show quoted text
Thank you.
Thank you
--
Adrian Klaver
adrian.klaver@aklaver.com--
Adrian Klaver
adrian.klaver@aklaver.com--
Adrian Klaver
adrian.klaver@aklaver.com
On Tuesday, May 12, 2026, Igor Korot <ikorot01@gmail.com> wrote:
So then I thought about creating MSVC project for building libpq as a
dependency. All I need is to produce a basic default build of both Debug
and Release builds of libpq only. No server and no ther software needed.
Prefer to build version 17.4.
You seem to have put yourself into cutting edge PostgreSQL territory while
remaining firmly old-school on the OS side of things…not usually a good
place to find oneself.
My LLM guided understanding is your likely 9.6 tool path was removed in
favor of meson back in 2023. But meson itself is still working out the
rough edges for stuff like a defined target for a libpq-only build and
install.
There is no guarantee or real attempt to keep modern supported versions
running on software obsoleted before they even came into existence. You
may or may not be able to finagle make/meson to do what you are attempting
and the desire to help is limited. You may wish to consult an LLM of your
choice for assistance. For something like this they can be very helpful
with little downside.
David J.
Hi, David,
On Tue, May 12, 2026 at 6:04 PM David G. Johnston <
david.g.johnston@gmail.com> wrote:
On Tuesday, May 12, 2026, Igor Korot <ikorot01@gmail.com> wrote:
So then I thought about creating MSVC project for building libpq as a
dependency. All I need is to produce a basic default build of both Debug
and Release builds of libpq only. No server and no ther software needed.
Prefer to build version 17.4.You seem to have put yourself into cutting edge PostgreSQL territory while
remaining firmly old-school on the OS side of things…not usually a good
place to find oneself.My LLM guided understanding is your likely 9.6 tool path was removed in
favor of meson back in 2023. But meson itself is still working out the
rough edges for stuff like a defined target for a libpq-only build and
install.There is no guarantee or real attempt to keep modern supported versions
running on software obsoleted before they even came into existence. You
may or may not be able to finagle make/meson to do what you are attempting
and the desire to help is limited. You may wish to consult an LLM of your
choice for assistance. For something like this they can be very helpful
with little downside.
What I don’t understand is:
1. There used to be a split builds - one package to build the server and
another to build the client (libpq). This is no longer the case.
PostgreSQL positions itself as client-server RDBMS, so why in order to
build the client I need the full blown server to download?
2. Any reason I need to install additional software for building (or
configuring the build)? You used to provide the Makefile for MSVC build.
What happened to it?
But to the point -
I’m not running Postgres server. It is running on the different machines.
All I need is to build the client library. Why can’t I? Why it should
matter what software (OS/compiler) I’m using? As long as I can successfully
build my software and test it it should be fine.
Thank you.
Show quoted text
David J.
On Tue, May 12, 2026 at 10:52 PM Igor Korot <ikorot01@gmail.com> wrote:
[snip]
I’m not running Postgres server. It is running on the different machines.
All I need is to build the client library. Why can’t I? Why it should
matter what software (OS/compiler) I’m using? As long as I can successfully
build my software and test it it should be fine.
David made it pretty clear: the *PGDG changed the toolchain*, and decided *not
to support* an OS that went *EOL* three years ago, and a compiler that's
only getting security updates: "There is no guarantee or real attempt to
keep modern supported versions running on software obsoleted before they
even came into existence."
--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!
On Tue, 2026-05-12 at 19:52 -0700, Igor Korot wrote:
There used to be a split builds - one package to build the server and another to build the client (libpq). This is no longer the case.
PostgreSQL positions itself as client-server RDBMS, so why in order to build the client I need the full blown server to download?
I don't have Windows at my disposal, so I cannot investigate this, but it
strikes me that you are complaining for the sake of complaining.
I have never seen a client-only source download for PostgreSQL, so you always
had to download the complete source. What is the problem? Does your
internet connection have a problem with downloading 30MB?
And if you have to build the entire server just to get the client library,
what is the problem with that? Yes, it will take somewhat longer, but I
don't see that as a problem unless you are building the software several
times a day, which seems unlikely for a production build.
It used to be that I could fit a custom-built Linux kernel on a 1.44MB
rescue floppy disk. Still, I don't complain to the LKML that I can no longer
do that.
Yours,
Laurenz Albe
Laurenz Albe <laurenz.albe@cybertec.at> writes:
On Tue, 2026-05-12 at 19:52 -0700, Igor Korot wrote:
There used to be a split builds - one package to build the server and another to build the client (libpq). This is no longer the case.
The short answer is that we dropped that build option because it
was no longer worth the trouble to support. Building the whole
package and then ignoring the parts you don't need takes only
a few minutes longer on any remotely-modern hardware. Certainly,
you've wasted more time complaining than it would take to do that.
regards, tom lane
Hi, Ron,
On Tue, May 12, 2026 at 8:10 PM Ron Johnson <ronljohnsonjr@gmail.com> wrote:
On Tue, May 12, 2026 at 10:52 PM Igor Korot <ikorot01@gmail.com> wrote:
[snip]I’m not running Postgres server. It is running on the different machines.
All I need is to build the client library. Why can’t I? Why it should
matter what software (OS/compiler) I’m using? As long as I can successfully
build my software and test it it should be fine.David made it pretty clear: the *PGDG changed the toolchain*,
It didn’t change the toolchain - it changed configuration tools. But it’s
not the point.
The point I’m making is that the software was providing the makefile and
now it does not.
Thank you.
and decided *not to support* an OS that went *EOL* three years ago, and a
Show quoted text
compiler that's only getting security updates: "There is no guarantee or
real attempt to keep modern supported versions running on software
obsoleted before they even came into existence."--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!