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

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

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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2023-02-27 05:27:16 Re: Change xl_hash_vacuum_one_page.ntuples from int to uint16
Previous Message Andrey Borodin 2023-02-27 04:55:45 Re: psql \watch 2nd argument: iteration count