RE: [PATCH] fix msvc build libpq error LNK2019 when link openssl;

From: gamefunc <32686647(at)qq(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: RE: [PATCH] fix msvc build libpq error LNK2019 when link openssl;
Date: 2023-02-27 07:33:50
Message-ID: tencent_88F2F9E0AB702D9AF2B1216239B2F5F3FF0A@qq.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

sorry i should have made it clear – I am only reporting my build error issue;
the patch is only for illustrative purpose, not for merging to upstream;
And my English is not good, so I can only write simple descriptions;
>> This diff forces the creation of a VS2022Solution():
yes, my env: vs2022, openssl3.0.7;

>> Note that buildfarm member drongo is providing coverage for 64b:
thank you, But I need to build libpq myself because I need to add functions to libpq for my example use; https://github.com/gamefunc/Aiolibpq_simple;

>> Are you sure that you just didn't mix 64b builds with 32b libraries;
no, all 64b;

From: Michael Paquier
Date: 2023年2月27日 13:27
To: gamefunc
CC: pgsql-hackers
Subject: Re: [PATCH] fix msvc build libpq error LNK2019 when link openssl;

On Mon, Feb 27, 2023 at 09:58:28AM +0800, gamefunc wrote:
> # I:
> (default target) (1) -&gt; (Link target) -&gt;
> libcrypto.lib(libcrypto-lib-e_capi.obj) : error LNK2019: __imp_CertOpenStore, capi_open_store
> libcrypto.lib(libcrypto-lib-e_capi.obj) : error LNK2019: __imp_CertCloseStore, capi_find_key
> libcrypto.lib(libcrypto-lib-e_capi.obj) : error LNK2019: __imp_CertEnumCertificatesInStore, capi_find_cert
> libcrypto.lib(libcrypto-lib-e_capi.obj) : error LNK2019: __imp_CertFindCertificateInStore, capi_find_cert
> libcrypto.lib(libcrypto-lib-e_capi.obj) : error LNK2019: __imp_CertDuplicateCertificateContext, capi_load_ssl_client_cert
> libcrypto.lib(libcrypto-lib-e_capi.obj) : error LNK2019: __imp_CertFreeCertificateContext, capi_dsa_free
> libcrypto.lib(libcrypto-lib-e_capi.obj) : error LNK2019: __imp_CertGetCertificateContextProperty, capi_cert_get_fname

@@ -94,7 +94,7 @@ sub mkvcbuild
die 'Must run from root or msvc directory'
unless (-d 'src/tools/msvc' && -d 'src')

- my $vsVersion = DetermineVisualStudioVersion();
+ my $vsVersion = "17.00";

This diff forces the creation of a VS2022Solution(), which would be
incorrect when using an MSVC environment different than 17.0 as
version number, no?

Note that buildfarm member drongo is providing coverage for 64b
Windows builds with Visual 2019 and OpenSSL:
https://buildfarm.postgresql.org/cgi-bin/show_history.pl?nm=drongo&br=HEAD

Are you sure that you just didn't mix 64b builds with 32b libraries,
or vice-versa?
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2023-02-27 07:45:49 Re: SQL/JSON revisited
Previous Message Heikki Linnakangas 2023-02-27 07:33:13 Re: pg_rewind: warn when checkpoint hasn't happened after promotion