microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
22.83k stars 6.3k forks source link

[libpq] Build error on x64-windows #38059

Closed diphdawuqi closed 5 months ago

diphdawuqi commented 5 months ago

Package: libpq[core,lz4,openssl,zlib]:x64-windows -> 16.2#1

Host Environment

To Reproduce

vcpkg install gdal:x64-windows Failure logs

-- Using cached postgresql-16.2.tar.bz2.
-- Cleaning sources at D:/dev/vcpkg/buildtrees/libpq/src/tgresql-16-b00fbb6ff2.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source D:/dev/vcpkg/downloads/postgresql-16.2.tar.bz2
-- Applying patch unix/installdirs.patch
-- Applying patch unix/fix-configure.patch
-- Applying patch unix/single-linkage.patch
-- Applying patch unix/no-server-tools.patch
-- Applying patch unix/mingw-install.patch
-- Applying patch unix/python.patch
-- Applying patch windows/macro-def.patch
-- Applying patch windows/win_bison_flex.patch
-- Applying patch windows/msbuild.patch
-- Applying patch windows/spin_delay.patch
-- Applying patch android/unversioned_so.patch
-- Using source at D:/dev/vcpkg/buildtrees/libpq/src/tgresql-16-b00fbb6ff2.clean
-- Getting CMake variables for x64-windows
-- Getting CMake variables for x64-windows
-- Using cached tzcode-2023c-1-x86_64.pkg.tar.zst.
-- Using cached msys2-autoconf-wrapper-20221207-1-any.pkg.tar.zst.
-- Using cached msys2-automake-wrapper-20221207-2-any.pkg.tar.zst.
-- Using cached msys2-binutils-2.42-1-x86_64.pkg.tar.zst.
-- Using cached msys2-libtool-2.4.7-3-x86_64.pkg.tar.zst.
-- Using cached msys2-make-4.4.1-1-x86_64.pkg.tar.zst.
-- Using cached msys2-pkgconf-2.1.0-1-x86_64.pkg.tar.zst.
-- Using cached msys2-which-2.21-4-x86_64.pkg.tar.zst.
-- Using cached msys2-autoconf-archive-2023.02.20-1-any.pkg.tar.zst.
-- Using cached msys2-bash-5.2.026-1-x86_64.pkg.tar.zst.
-- Using cached msys2-coreutils-8.32-5-x86_64.pkg.tar.zst.
-- Using cached msys2-file-5.45-1-x86_64.pkg.tar.zst.
-- Using cached msys2-gawk-5.3.0-1-x86_64.pkg.tar.zst.
-- Using cached msys2-grep-1~3.0-6-x86_64.pkg.tar.zst.
-- Using cached msys2-gzip-1.13-1-x86_64.pkg.tar.zst.
-- Using cached msys2-diffutils-3.10-1-x86_64.pkg.tar.zst.
-- Using cached msys2-sed-4.9-1-x86_64.pkg.tar.zst.
-- Using cached msys2-msys2-runtime-3.4.10-4-x86_64.pkg.tar.zst.
-- Using cached msys2-autoconf2.71-2.71-3-any.pkg.tar.zst.
-- Using cached msys2-automake1.16-1.16.5-1-any.pkg.tar.zst.
-- Using cached msys2-libiconv-1.17-1-x86_64.pkg.tar.zst.
-- Using cached msys2-libintl-0.22.4-1-x86_64.pkg.tar.zst.
-- Using cached msys2-zlib-1.3.1-1-x86_64.pkg.tar.zst.
-- Using cached msys2-tar-1.35-2-x86_64.pkg.tar.zst.
-- Using cached msys2-findutils-4.9.0-3-x86_64.pkg.tar.zst.
-- Using cached msys2-gmp-6.3.0-1-x86_64.pkg.tar.zst.
-- Using cached msys2-gcc-libs-13.2.0-2-x86_64.pkg.tar.zst.
-- Using cached msys2-libbz2-1.0.8-4-x86_64.pkg.tar.zst.
-- Using cached msys2-liblzma-5.4.6-2-x86_64.pkg.tar.zst.
-- Using cached msys2-libzstd-1.5.5-1-x86_64.pkg.tar.zst.
-- Using cached msys2-libreadline-8.2.010-1-x86_64.pkg.tar.zst.
-- Using cached msys2-mpfr-4.2.1-1-x86_64.pkg.tar.zst.
-- Using cached msys2-libpcre-8.45-4-x86_64.pkg.tar.zst.
-- Using cached msys2-m4-1.4.19-2-x86_64.pkg.tar.zst.
-- Using cached msys2-perl-5.38.2-1-x86_64.pkg.tar.zst.
-- Using cached msys2-ncurses-6.4-2-x86_64.pkg.tar.zst.
-- Using cached msys2-libxcrypt-4.4.36-1-x86_64.pkg.tar.zst.
-- Using msys root at D:/dev/vcpkg/downloads/tools/msys2/33e2a3f4425f018d
-- Generating configure for x64-windows
-- Finished generating configure for x64-windows
-- Using cached msys2-mingw-w64-x86_64-pkgconf-1~2.2.0-1-any.pkg.tar.zst.
-- Using cached msys2-msys2-runtime-3.4.10-4-x86_64.pkg.tar.zst.
-- Using msys root at D:/dev/vcpkg/downloads/tools/msys2/d33df895d441a36d
-- Configuring x64-windows-dbg
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:112 (message):
    Command failed: D:/dev/vcpkg/downloads/tools/msys2/33e2a3f4425f018d/usr/bin/bash.exe --noprofile --norc --debug -c "V=1 CPP='compile cl.exe -E' CC='compile cl.exe' CC_FOR_BUILD='compile cl.exe' CPP_FOR_BUILD='compile cl.exe -E' CXX_FOR_BUILD='compile cl.exe' CXX='compile cl.exe' RC='windres-rc rc.exe' WINDRES='windres-rc rc.exe' AR='ar-lib lib.exe' LD='link.exe -verbose' RANLIB=':' STRIP=':' NM='dumpbin.exe -symbols -headers' DLLTOOL='link.exe -verbose -dll' CCAS=':' AS=':' ././configure --build=x86_64-pc-mingw32 \"--without-icu\" \"--with-lz4\" \"--without-nls\" \"--with-openssl\" \"--without-readline\" \"--without-xml\" \"--without-xslt\" \"--with-zlib\" \"--without-zstd\" \"ac_cv_prog_ac_ct_STRIP=:\" \"gl_cv_double_slash_root=yes\" \"ac_cv_func_memmove=yes\" \"--disable-silent-rules\" \"--verbose\" \"--enable-shared\" \"--disable-static\" \"--enable-debug\" \"--prefix=/D/dev/vcpkg/installed/x64-windows/debug\" \"--bindir=\\${prefix}/../tools/libpq/debug/bin\" \"--sbindir=\\${prefix}/../tools/libpq/debug/sbin\" \"--libdir=\\${prefix}/lib\" \"--includedir=\\${prefix}/../include\" \"--datarootdir=\\${prefix}/share/libpq\""
    Working Directory: D:/dev/vcpkg/buildtrees/libpq/x64-windows-dbg
    Error code: 1
    See logs for more information:
      D:\dev\vcpkg\buildtrees\libpq\config-x64-windows-dbg-config.log
      D:\dev\vcpkg\buildtrees\libpq\config-x64-windows-dbg-out.log
      D:\dev\vcpkg\buildtrees\libpq\config-x64-windows-dbg-err.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_configure_make.cmake:863 (vcpkg_execute_required_process)
  ports/libpq/portfile.cmake:115 (vcpkg_configure_make)
  scripts/ports.cmake:175 (include)
D:\dev\vcpkg\buildtrees\libpq\config-x64-windows-dbg-err.log ``` configure: WARNING: unrecognized options: --without-nls, --without-xml, --without-xslt, --disable-silent-rules, --enable-shared, --disable-static configure: error: C compiler "compile cl.exe" does not support C99 ```
D:\dev\vcpkg\buildtrees\libpq\config-x64-windows-dbg-out.log ``` checking build system type... x86_64-pc-mingw32 checking host system type... x86_64-pc-mingw32 checking which template to use... win32 checking whether NLS is wanted... no checking for default port number... 5432 checking for block size... 8kB checking for segment size... 1GB checking for WAL block size... 8kB checking whether the C compiler works... yes checking for C compiler default output file name... conftest.exe checking for suffix of executables... .exe checking whether we are cross compiling... yes checking for suffix of object files... obj checking whether the compiler supports GNU C... no checking whether compile cl.exe accepts -g... yes checking for compile cl.exe option to enable C11 features... unsupported checking for compile cl.exe option to enable C99 features... unsupported checking for compile cl.exe option to enable C89 features... unsupported ```
D:\dev\vcpkg\buildtrees\libpq\config-x64-windows-dbg-config.log ``` This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by PostgreSQL configure 16.2, which was generated by GNU Autoconf 2.71. Invocation command line was $ ././configure --build=x86_64-pc-mingw32 --without-icu --with-lz4 --without-nls --with-openssl --without-readline --without-xml --without-xslt --with-zlib --without-zstd ac_cv_prog_ac_ct_STRIP=: gl_cv_double_slash_root=yes ac_cv_func_memmove=yes --disable-silent-rules --verbose --enable-shared --disable-static --enable-debug --prefix=/D/dev/vcpkg/installed/x64-windows/debug '--bindir=${prefix}/../tools/libpq/debug/bin' '--sbindir=${prefix}/../tools/libpq/debug/sbin' '--libdir=${prefix}/lib' '--includedir=${prefix}/../include' '--datarootdir=${prefix}/share/libpq' ## Platform. ## ## --------- ## hostname = LAPTOP-N8C9HH01 uname -m = x86_64 uname -r = 3.4.10.x86_64 uname -s = MSYS_NT-10.0-19045 uname -v = 2023-12-22 10:06 UTC /usr/bin/uname -p = unknown /bin/uname -X = unknown /bin/arch = x86_64 /usr/bin/arch -k = unknown /usr/convex/getsysinfo = unknown /usr/bin/hostinfo = unknown /bin/machine = unknown /usr/bin/oslevel = unknown /bin/universe = unknown PATH: /d/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.36.32532/bin/Hostx64/x64/ PATH: /d/dev/vcpkg/downloads/tools/win_bison/2.5.25/ PATH: /d/dev/vcpkg/downloads/tools/perl/5.38.0.1/perl/bin/ PATH: /d/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.36.32532/bin/HostX64/x64/ PATH: /d/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/VC/VCPackages/ PATH: /d/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/TestWindow/ PATH: /d/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/TeamFoundation/Team Explorer/ PATH: /d/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/bin/Roslyn/ PATH: /d/Program Files/Microsoft Visual Studio/2022/Community/Team Tools/Performance Tools/x64/ PATH: /d/Program Files/Microsoft Visual Studio/2022/Community/Team Tools/Performance Tools/ PATH: /d/Program Files (x86)/Microsoft Visual Studio/Shared/Common/VSPerfCollectionTools/vs2019/x64/ PATH: /d/Program Files (x86)/Microsoft Visual Studio/Shared/Common/VSPerfCollectionTools/vs2019/ PATH: /c/Program Files (x86)/Microsoft SDKs/Windows/v10.0A/bin/NETFX 4.8 Tools/x64/ PATH: /d/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/FSharp/Tools/ PATH: /d/Windows Kits/10/bin/10.0.22000.0/x64/ PATH: /d/Windows Kits/10/bin/x64/ PATH: /d/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/amd64/ PATH: /c/Windows/Microsoft.NET/Framework64/v4.0.30319/ PATH: /d/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/ PATH: /d/Program Files/Microsoft Visual Studio/2022/Community/Common7/Tools/ PATH: /d/dev/vcpkg/downloads/tools/powershell-core-7.2.16-windows/ PATH: /d/dev/vcpkg/scripts/buildsystems/make_wrapper/ PATH: /usr/share/automake-1.16/ PATH: /usr/bin/ PATH: /c/Windows/system32/ PATH: /c/Windows/ PATH: /c/Windows/system32/Wbem/ PATH: /c/Windows/system32/WindowsPowerShell/v1.0/ PATH: /d/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/Llvm/x64/bin/ PATH: /d/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/ PATH: /d/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ PATH: /d/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/VC/Linux/bin/ConnectionManagerExe/ PATH: /d/Program Files/Microsoft Visual Studio/2022/Community/VC/vcpkg/ PATH: /d/dev/vcpkg/downloads/tools/ninja/1.10.2-windows/ PATH: /d/dev/vcpkg/downloads/tools/msys2/d33df895d441a36d/mingw64/bin/ ## Core tests. ## configure:3299: looking for aux files: install-sh config.guess config.sub configure:3312: trying ./config/ configure:3323: ./config/install-sh found configure:3341: ./config/config.guess found configure:3341: ./config/config.sub found configure:3512: checking build system type configure:3527: result: x86_64-pc-mingw32 configure:3547: checking host system type configure:3561: result: x86_64-pc-mingw32 configure:3583: checking which template to use configure:3651: result: win32 configure:3783: checking whether NLS is wanted configure:3816: result: no configure:3824: checking for default port number configure:3850: result: 5432 configure:4351: checking for block size configure:4386: result: 8kB configure:4453: checking for segment size configure:4460: result: 1GB configure:4475: checking for WAL block size configure:4511: result: 8kB configure:4684: checking for C compiler version configure:4693: compile cl.exe --version >&5 cl : Command line warning D9002 : ignoring unknown option '--version' configure:4693: compile cl.exe -v >&5 cl : Command line warning D9002 : ignoring unknown option '-v' configure:4693: compile cl.exe -V >&5 cl : Command line error D8004 : '/V' requires an argument configure:4693: compile cl.exe -qversion >&5 cl : Command line warning D9002 : ignoring unknown option '-qversion' configure:4693: compile cl.exe -version >&5 Microsoft (R) C/C++ Optimizing Compiler Version 19.36.32534 for x64 Copyright (C) Microsoft Corporation. All rights reserved. cl : Command line warning D9002 : ignoring unknown option '-version' cl : Command line error D8003 : missing source filename configure:4704: $? = 2 configure:4724: checking whether the C compiler works configure:4746: compile cl.exe -Xcompiler -nologo -Xcompiler -W3 -Xcompiler -utf-8 -Xcompiler -MP -Xcompiler -MDd -Xcompiler -Z7 -Xcompiler -Ob0 -Xcompiler -Od -Xcompiler -RTC1 -DWIN32 -D_WINDOWS -D_DEBUG -Xlinker -Xlinker -Xlinker -LIBPATH:D:/dev/vcpkg/installed/x64-windows/debug/lib -Xlinker -Xlinker -Xlinker -LIBPATH:D:/dev/vcpkg/installed/x64-windows/debug/lib/manual-link -Xlinker -Xlinker -Xlinker -machine:x64 -Xlinker -Xlinker -Xlinker -nologo -Xlinker -Xlinker -Xlinker -debug -Xlinker -Xlinker -Xlinker -INCREMENTAL conftest.c -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -lcomdlg32 -ladvapi32 >&5 LINK : warning LNK4044: unrecognized option '/Xlinker'; ignored configure:4750: $? = 0 configure:4800: result: yes configure:4803: checking for C compiler default output file name configure:4805: result: conftest.exe configure:4811: checking for suffix of executables configure:4818: compile cl.exe -o conftest.exe -Xcompiler -nologo -Xcompiler -W3 -Xcompiler -utf-8 -Xcompiler -MP -Xcompiler -MDd -Xcompiler -Z7 -Xcompiler -Ob0 -Xcompiler -Od -Xcompiler -RTC1 -DWIN32 -D_WINDOWS -D_DEBUG -Xlinker -Xlinker -Xlinker -LIBPATH:D:/dev/vcpkg/installed/x64-windows/debug/lib -Xlinker -Xlinker -Xlinker -LIBPATH:D:/dev/vcpkg/installed/x64-windows/debug/lib/manual-link -Xlinker -Xlinker -Xlinker -machine:x64 -Xlinker -Xlinker -Xlinker -nologo -Xlinker -Xlinker -Xlinker -debug -Xlinker -Xlinker -Xlinker -INCREMENTAL conftest.c -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -lcomdlg32 -ladvapi32 >&5 Skipped 2814 lines ... configure:5196: compile cl.exe -qlanglvl=ansi -c -Xcompiler -nologo -Xcompiler -W3 -Xcompiler -utf-8 -Xcompiler -MP -Xcompiler -MDd -Xcompiler -Z7 -Xcompiler -Ob0 -Xcompiler -Od -Xcompiler -RTC1 -DWIN32 -D_WINDOWS -D_DEBUG conftest.c >&5 cl : Command line warning D9002 : ignoring unknown option '-qlanglvl=ansi' configure:5196: compile cl.exe -std -c -Xcompiler -nologo -Xcompiler -W3 -Xcompiler -utf-8 -Xcompiler -MP -Xcompiler -MDd -Xcompiler -Z7 -Xcompiler -Ob0 -Xcompiler -Od -Xcompiler -RTC1 -DWIN32 -D_WINDOWS -D_DEBUG conftest.c >&5 cl : Command line warning D9002 : ignoring unknown option '-std' configure:5196: compile cl.exe -Ae -c -Xcompiler -nologo -Xcompiler -W3 -Xcompiler -utf-8 -Xcompiler -MP -Xcompiler -MDd -Xcompiler -Z7 -Xcompiler -Ob0 -Xcompiler -Od -Xcompiler -RTC1 -DWIN32 -D_WINDOWS -D_DEBUG conftest.c >&5 cl : Command line warning D9002 : ignoring unknown option '-Ae' configure:5196: compile cl.exe -Aa -D_HPUX_SOURCE -c -Xcompiler -nologo -Xcompiler -W3 -Xcompiler -utf-8 -Xcompiler -MP -Xcompiler -MDd -Xcompiler -Z7 -Xcompiler -Ob0 -Xcompiler -Od -Xcompiler -RTC1 -DWIN32 -D_WINDOWS -D_DEBUG conftest.c >&5 cl : Command line warning D9002 : ignoring unknown option '-Aa' configure:5196: compile cl.exe -Xc -D__EXTENSIONS__ -c -Xcompiler -nologo -Xcompiler -W3 -Xcompiler -utf-8 -Xcompiler -MP -Xcompiler -MDd -Xcompiler -Z7 -Xcompiler -Ob0 -Xcompiler -Od -Xcompiler -RTC1 -DWIN32 -D_WINDOWS -D_DEBUG conftest.c >&5 conftest.c conftest.c(24): fatal error C1189: #error: "Compiler does not advertise C89 conformance" cl : Command line warning D9002 : ignoring unknown option '-Xc' cl : Command line warning D9002 : ignoring unknown option '-Xcompiler' configure:5196: $? = 2 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "PostgreSQL" | #define PACKAGE_TARNAME "postgresql" | #define PACKAGE_VERSION "16.2" | #define PACKAGE_STRING "PostgreSQL 16.2" | #define PACKAGE_BUGREPORT "pgsql-bugs@lists.postgresql.org" | #define PACKAGE_URL "https://www.postgresql.org/" | #define CONFIGURE_ARGS " '--build=x86_64-pc-mingw32' '--without-icu' '--with-lz4' '--without-nls' '--with-openssl' '--without-readline' '--without-xml' '--without-xslt' '--with-zlib' '--without-zstd' 'ac_cv_prog_ac_ct_STRIP=:' 'gl_cv_double_slash_root=yes' 'ac_cv_func_memmove=yes' '--disable-silent-rules' '--verbose' '--enable-shared' '--disable-static' '--enable-debug' '--prefix=/D/dev/vcpkg/installed/x64-windows/debug' '--bindir=${prefix}/../tools/libpq/debug/bin' '--sbindir=${prefix}/../tools/libpq/debug/sbin' '--libdir=${prefix}/lib' '--includedir=${prefix}/../include' '--datarootdir=${prefix}/share/libpq' 'build_alias=x86_64-pc-mingw32' 'CC=compile cl.exe' 'CFLAGS=-Xcompiler -nologo -Xcompiler -W3 -Xcompiler -utf-8 -Xcompiler -MP -Xcompiler -MDd -Xcompiler -Z7 -Xcompiler -Ob0 -Xcompiler -Od -Xcompiler -RTC1' 'LDFLAGS=-Xlinker -Xlinker -Xlinker -LIBPATH:D:/dev/vcpkg/installed/x64-windows/debug/lib -Xlinker -Xlinker -Xlinker -LIBPATH:D:/dev/vcpkg/installed/x64-windows/debug/lib/manual-link -Xlinker -Xlinker -Xlinker -machine:x64 -Xlinker -Xlinker -Xlinker -nologo -Xlinker -Xlinker -Xlinker -debug -Xlinker -Xlinker -Xlinker -INCREMENTAL' 'LIBS=-lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -lcomdlg32 -ladvapi32' 'CPPFLAGS=-DWIN32 -D_WINDOWS -D_DEBUG' 'CXX=compile cl.exe' 'CXXFLAGS=-Xcompiler -nologo -Xcompiler -W3 -Xcompiler -utf-8 -Xcompiler -GR -Xcompiler -EHsc -Xcompiler -MP -Xcompiler -MDd -Xcompiler -Z7 -Xcompiler -Ob0 -Xcompiler -Od -Xcompiler -RTC1' 'CPP=compile cl.exe -E' 'PKG_CONFIG=D:/dev/vcpkg/downloads/tools/msys2/d33df895d441a36d/mingw64/bin/pkg-config.exe' 'PKG_CONFIG_PATH=D:/dev/vcpkg/packages/libpq_x64-windows/debug/lib/pkgconfig;D:/dev/vcpkg/packages/libpq_x64-windows/share/pkgconfig;D:/dev/vcpkg/installed/x64-windows/debug/lib/pkgconfig;D:/dev/vcpkg/installed/x64-windows/share/pkgconfig'" | #define PG_MAJORVERSION "16" | #define PG_MAJORVERSION_NUM 16 | #define PG_MINORVERSION_NUM 2 | #define PG_VERSION "16.2" | #define DEF_PGPORT 5432 | #define DEF_PGPORT_STR "5432" | #define BLCKSZ 8192 | #define RELSEG_SIZE 131072 | #define XLOG_BLCKSZ 8192 | /* end confdefs.h. */ | /* Does the compiler advertise C89 conformance? | Do not test the value of __STDC__, because some compilers set it to 0 | while being otherwise adequately conformant. */ | #if !defined __STDC__ | # error "Compiler does not advertise C89 conformance" | #endif | #include | #include | struct stat; | /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ | struct buf { int x; }; | struct buf * (*rcsopen) (struct buf *, struct stat *, int); | static char *e (char **p, int i) | return p[i]; | static char *f (char * (*g) (char **, int), char **p, ...) | char *s; | va_list v; | va_start (v,p); | s = g (p, va_arg (v,int)); | va_end (v); | return s; | /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has | function prototypes and stuff, but not \xHH hex character constants. | These do not provoke an error unfortunately, instead are silently treated | as an "x". The following induces an error, until -std is added to get | proper ANSI mode. Curiously \x00 != x always comes out true, for an | array size at least. It is necessary to write \x00 == 0 to get something | that is true only with -std. */ | int osf4_cc_array ['\x00' == 0 ? 1 : -1]; | /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters | inside strings and character constants. */ | #define FOO(x) 'x' | int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; | int test (int i, double x); | struct s1 {int (*f) (int a);}; | struct s2 {int (*f) (double a);}; | int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), | int, int); | int | main (int argc, char **argv) | { | int ok = 0; | | ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); | return ok; | } | configure:5209: result: unsupported configure:5237: error: C compiler "compile cl.exe" does not support C99 ## Cache variables. ## ## ---------------- ## ac_cv_build=x86_64-pc-mingw32 ac_cv_c_compiler_gnu=no ac_cv_env_CCC_set= ac_cv_env_CCC_value= ac_cv_env_CC_set=set ac_cv_env_CC_value='compile cl.exe' ac_cv_env_CFLAGS_set=set ac_cv_env_CFLAGS_value='-Xcompiler -nologo -Xcompiler -W3 -Xcompiler -utf-8 -Xcompiler -MP -Xcompiler -MDd -Xcompiler -Z7 -Xcompiler -Ob0 -Xcompiler -Od -Xcompiler -RTC1' ac_cv_env_CLANG_set= ac_cv_env_CLANG_value= ac_cv_env_CPPFLAGS_set=set ac_cv_env_CPPFLAGS_value='-DWIN32 -D_WINDOWS -D_DEBUG' ac_cv_env_CPP_set=set ac_cv_env_CPP_value='compile cl.exe -E' ac_cv_env_CRYPTO_new_ex_data_CFLAGS_set= ac_cv_env_CRYPTO_new_ex_data_CFLAGS_value= ac_cv_env_CRYPTO_new_ex_data_LIBS_set= ac_cv_env_CRYPTO_new_ex_data_LIBS_value= ac_cv_env_CXXFLAGS_set=set ac_cv_env_CXXFLAGS_value='-Xcompiler -nologo -Xcompiler -W3 -Xcompiler -utf-8 -Xcompiler -GR -Xcompiler -EHsc -Xcompiler -MP -Xcompiler -MDd -Xcompiler -Z7 -Xcompiler -Ob0 -Xcompiler -Od -Xcompiler -RTC1' ac_cv_env_CXX_set=set ac_cv_env_CXX_value='compile cl.exe' ac_cv_env_ICU_CFLAGS_set= ac_cv_env_ICU_CFLAGS_value= ac_cv_env_ICU_LIBS_set= ac_cv_env_ICU_LIBS_value= ac_cv_env_LDFLAGS_EX_set= ac_cv_env_LDFLAGS_EX_value= ac_cv_env_LDFLAGS_SL_set= ac_cv_env_LDFLAGS_SL_value= ac_cv_env_LDFLAGS_set=set ac_cv_env_LDFLAGS_value='-Xlinker -Xlinker -Xlinker -LIBPATH:D:/dev/vcpkg/installed/x64-windows/debug/lib -Xlinker -Xlinker -Xlinker -LIBPATH:D:/dev/vcpkg/installed/x64-windows/debug/lib/manual-link -Xlinker -Xlinker -Xlinker -machine:x64 -Xlinker -Xlinker -Xlinker -nologo -Xlinker -Xlinker -Xlinker -debug -Xlinker -Xlinker -Xlinker -INCREMENTAL' ac_cv_env_LIBS_set=set ac_cv_env_LIBS_value='-lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -lcomdlg32 -ladvapi32' ac_cv_env_LIBXML2_CFLAGS_set= ac_cv_env_LIBXML2_CFLAGS_value= ac_cv_env_LIBXML2_LIBS_set= ac_cv_env_LIBXML2_LIBS_value= ac_cv_env_LIBXSLT_CFLAGS_set= ac_cv_env_LIBXSLT_CFLAGS_value= ac_cv_env_LIBXSLT_LIBS_set= ac_cv_env_LIBXSLT_LIBS_value= ac_cv_env_LLVM_CONFIG_set= ac_cv_env_LLVM_CONFIG_value= ac_cv_env_LZ4_CFLAGS_set= ac_cv_env_LZ4_CFLAGS_value= ac_cv_env_LZ4_LIBS_set= ac_cv_env_LZ4_LIBS_value= ac_cv_env_MSGFMT_set= ac_cv_env_MSGFMT_value= ac_cv_env_PERL_set= ac_cv_env_PERL_value= ac_cv_env_PKG_CONFIG_LIBDIR_set= ac_cv_env_PKG_CONFIG_LIBDIR_value= ac_cv_env_PKG_CONFIG_PATH_set=set ac_cv_env_PKG_CONFIG_PATH_value='D:/dev/vcpkg/packages/libpq_x64-windows/debug/lib/pkgconfig;D:/dev/vcpkg/packages/libpq_x64-windows/share/pkgconfig;D:/dev/vcpkg/installed/x64-windows/debug/lib/pkgconfig;D:/dev/vcpkg/installed/x64-windows/share/pkgconfig' ac_cv_env_PKG_CONFIG_set=set ac_cv_env_PKG_CONFIG_value=D:/dev/vcpkg/downloads/tools/msys2/d33df895d441a36d/mingw64/bin/pkg-config.exe ac_cv_env_PYTHON_EMBED_CFLAGS_set= ac_cv_env_PYTHON_EMBED_CFLAGS_value= ac_cv_env_PYTHON_EMBED_LIBS_set= ac_cv_env_PYTHON_EMBED_LIBS_value= ac_cv_env_PYTHON_set= ac_cv_env_PYTHON_value= ac_cv_env_READLINE_CFLAGS_set= ac_cv_env_READLINE_CFLAGS_value= ac_cv_env_READLINE_LIBS_set= ac_cv_env_READLINE_LIBS_value= ac_cv_env_SSL_new_CFLAGS_set= ac_cv_env_SSL_new_CFLAGS_value= ac_cv_env_SSL_new_LIBS_set= ac_cv_env_SSL_new_LIBS_value= ac_cv_env_TCLSH_set= ac_cv_env_TCLSH_value= ac_cv_env_XML2_CFLAGS_set= ac_cv_env_XML2_CFLAGS_value= ac_cv_env_XML2_CONFIG_set= ac_cv_env_XML2_CONFIG_value= ac_cv_env_XML2_LIBS_set= ac_cv_env_XML2_LIBS_value= ac_cv_env_ZLIB_CFLAGS_set= ac_cv_env_ZLIB_CFLAGS_value= ac_cv_env_ZLIB_LIBS_set= ac_cv_env_ZLIB_LIBS_value= ac_cv_env_ZSTD_CFLAGS_set= ac_cv_env_ZSTD_CFLAGS_value= ac_cv_env_ZSTD_LIBS_set= ac_cv_env_ZSTD_LIBS_value= ac_cv_env_build_alias_set=set ac_cv_env_build_alias_value=x86_64-pc-mingw32 ac_cv_env_host_alias_set= ac_cv_env_host_alias_value= ac_cv_env_target_alias_set= ac_cv_env_target_alias_value= ac_cv_exeext=.exe ac_cv_func_memmove=yes ac_cv_host=x86_64-pc-mingw32 ac_cv_objext=obj ac_cv_prog_ac_ct_STRIP=: ac_cv_prog_cc_c11=no ac_cv_prog_cc_c89=no ac_cv_prog_cc_c99=no ac_cv_prog_cc_g=yes gl_cv_double_slash_root=yes ## Output variables. ## ## ----------------- ## AR='ar-lib lib.exe' AWK='' BISON='' BISONFLAGS='' BITCODE_CFLAGS='' BITCODE_CXXFLAGS='' CC='compile cl.exe' CFLAGS='-Xcompiler -nologo -Xcompiler -W3 -Xcompiler -utf-8 -Xcompiler -MP -Xcompiler -MDd -Xcompiler -Z7 -Xcompiler -Ob0 -Xcompiler -Od -Xcompiler -RTC1' CFLAGS_CRC='' CFLAGS_SL='' CFLAGS_SL_MODULE='' CFLAGS_UNROLL_LOOPS='' CFLAGS_VECTORIZE='' CLANG='' CPP='compile cl.exe -E' CPPFLAGS='-DWIN32 -D_WINDOWS -D_DEBUG' CRYPTO_new_ex_data_CFLAGS='' CRYPTO_new_ex_data_LIBS='' CXX='compile cl.exe' CXXFLAGS='-Xcompiler -nologo -Xcompiler -W3 -Xcompiler -utf-8 -Xcompiler -GR -Xcompiler -EHsc -Xcompiler -MP -Xcompiler -MDd -Xcompiler -Z7 -Xcompiler -Ob0 -Xcompiler -Od -Xcompiler -RTC1' CXXFLAGS_SL_MODULE='' DBTOEPUB='' DEFS='' DLSUFFIX='.so' DTRACE='' DTRACEFLAGS='' ECHO_C='' ECHO_N='-n' ECHO_T='' EGREP='' EXEEXT='.exe' FLEX='' FLEXFLAGS='' FOP='' GCC='' GCOV='' GENHTML='' GREP='' ICU_CFLAGS='' ICU_LIBS='' INCLUDES='' INSTALL_DATA='' INSTALL_PROGRAM='' INSTALL_SCRIPT='' LCOV='' LDAP_LIBS_BE='' LDAP_LIBS_FE='' LDFLAGS='-Xlinker -Xlinker -Xlinker -LIBPATH:D:/dev/vcpkg/installed/x64-windows/debug/lib -Xlinker -Xlinker -Xlinker -LIBPATH:D:/dev/vcpkg/installed/x64-windows/debug/lib/manual-link -Xlinker -Xlinker -Xlinker -machine:x64 -Xlinker -Xlinker -Xlinker -nologo -Xlinker -Xlinker -Xlinker -debug -Xlinker -Xlinker -Xlinker -INCREMENTAL' LDFLAGS_EX='' LDFLAGS_EX_BE='' LDFLAGS_SL='' LIBOBJS='' LIBS='-lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -lcomdlg32 -ladvapi32' LIBXML2_CFLAGS='' LIBXML2_LIBS='' LIBXSLT_CFLAGS='' LIBXSLT_LIBS='' LLVM_BINPATH='' LLVM_CFLAGS='' LLVM_CONFIG='' LLVM_CPPFLAGS='' LLVM_CXXFLAGS='' LLVM_LIBS='' LN_S='' LTLIBOBJS='' LZ4='' LZ4_CFLAGS='' LZ4_LIBS='' MKDIR_P='' MSGFMT='' MSGFMT_FLAGS='' MSGMERGE='' OBJEXT='obj' OPENSSL='' PACKAGE_BUGREPORT='pgsql-bugs@lists.postgresql.org' PACKAGE_NAME='PostgreSQL' PACKAGE_STRING='PostgreSQL 16.2' PACKAGE_TARNAME='postgresql' PACKAGE_URL='https://www.postgresql.org/' PACKAGE_VERSION='16.2' PATH_SEPARATOR=':' PERL='' PERMIT_DECLARATION_AFTER_STATEMENT='' PG_CRC32C_OBJS='' PG_MAJORVERSION='16' PG_SYSROOT='' PG_VERSION_NUM='' PKG_CONFIG='D:/dev/vcpkg/downloads/tools/msys2/d33df895d441a36d/mingw64/bin/pkg-config.exe' PKG_CONFIG_LIBDIR='' PKG_CONFIG_PATH='D:/dev/vcpkg/packages/libpq_x64-windows/debug/lib/pkgconfig;D:/dev/vcpkg/packages/libpq_x64-windows/share/pkgconfig;D:/dev/vcpkg/installed/x64-windows/debug/lib/pkgconfig;D:/dev/vcpkg/installed/x64-windows/share/pkgconfig' PORTNAME='win32' PROVE='' PTHREAD_CC='' PTHREAD_CFLAGS='' PTHREAD_LIBS='' PYTHON='' PYTHON_EMBED_CFLAGS='' PYTHON_EMBED_LIBS='' READLINE_CFLAGS='' READLINE_LIBS='' SED='' SHELL='/bin/sh' SSL_new_CFLAGS='' SSL_new_LIBS='' STRIP=':' STRIP_SHARED_LIB='' STRIP_STATIC_LIB='' SUN_STUDIO_CC='' TAR='' TAS='' TCLSH='' TCL_CONFIG_SH='' TCL_INCLUDE_SPEC='' TCL_LIBS='' TCL_LIB_SPEC='' TCL_SHARED_BUILD='' UUID_LIBS='' WANTED_LANGUAGES='' WINDRES='windres-rc rc.exe' XGETTEXT='' XML2_CFLAGS='' XML2_CONFIG='' XML2_LIBS='' XMLLINT='' XSLTPROC='' ZIC='' ZLIB_CFLAGS='' ZLIB_LIBS='' ZSTD='' ZSTD_CFLAGS='' ZSTD_LIBS='' ac_ct_CC='' ac_ct_CXX='' autodepend='' ax_pthread_config='' bindir='${prefix}/../tools/libpq/debug/bin' build='x86_64-pc-mingw32' build_alias='x86_64-pc-mingw32' build_cpu='x86_64' build_os='mingw32' build_vendor='pc' datadir='${datarootdir}' datarootdir='${prefix}/share/libpq' default_port='5432' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' dvidir='${docdir}' enable_coverage='no' enable_debug='yes' enable_dtrace='no' enable_nls='no' enable_rpath='yes' enable_tap_tests='no' enable_thread_safety='' exec_prefix='NONE' host='x86_64-pc-mingw32' host_alias='' host_cpu='x86_64' host_os='mingw32' host_vendor='pc' htmldir='${docdir}' includedir='${prefix}/../include' infodir='${datarootdir}/info' install_bin='' krb_srvtab='' libdir='${prefix}/lib' libexecdir='${exec_prefix}/libexec' localedir='${datarootdir}/locale' localstatedir='${prefix}/var' mandir='${datarootdir}/man' oldincludedir='/usr/include' pdfdir='${docdir}' perl_archlibexp='' perl_embed_ccflags='' perl_embed_ldflags='' perl_includespec='' perl_privlibexp='' perl_useshrplib='' prefix='/D/dev/vcpkg/installed/x64-windows/debug' program_transform_name='s,x,x,' psdir='${docdir}' python_additional_libs='' python_includespec='' python_libdir='' python_libspec='' python_majorversion='' python_version='' runstatedir='${localstatedir}/run' sbindir='${prefix}/../tools/libpq/debug/sbin' sharedstatedir='${prefix}/com' sysconfdir='${prefix}/etc' target_alias='' vpath_build='' with_gssapi='' with_icu='no' with_krb_srvnam='' with_ldap='' with_libxml='' with_libxslt='' with_llvm='' with_lz4='yes' with_perl='' with_python='' with_readline='no' with_selinux='' with_ssl='' with_system_tzdata='' with_systemd='' with_tcl='' with_uuid='' with_zlib='yes' with_zstd='no' ## confdefs.h. ## ## ----------- ## /* confdefs.h */ #define PACKAGE_NAME "PostgreSQL" #define PACKAGE_TARNAME "postgresql" #define PACKAGE_VERSION "16.2" #define PACKAGE_STRING "PostgreSQL 16.2" #define PACKAGE_BUGREPORT "pgsql-bugs@lists.postgresql.org" #define PACKAGE_URL "https://www.postgresql.org/" #define CONFIGURE_ARGS " '--build=x86_64-pc-mingw32' '--without-icu' '--with-lz4' '--without-nls' '--with-openssl' '--without-readline' '--without-xml' '--without-xslt' '--with-zlib' '--without-zstd' 'ac_cv_prog_ac_ct_STRIP=:' 'gl_cv_double_slash_root=yes' 'ac_cv_func_memmove=yes' '--disable-silent-rules' '--verbose' '--enable-shared' '--disable-static' '--enable-debug' '--prefix=/D/dev/vcpkg/installed/x64-windows/debug' '--bindir=${prefix}/../tools/libpq/debug/bin' '--sbindir=${prefix}/../tools/libpq/debug/sbin' '--libdir=${prefix}/lib' '--includedir=${prefix}/../include' '--datarootdir=${prefix}/share/libpq' 'build_alias=x86_64-pc-mingw32' 'CC=compile cl.exe' 'CFLAGS=-Xcompiler -nologo -Xcompiler -W3 -Xcompiler -utf-8 -Xcompiler -MP -Xcompiler -MDd -Xcompiler -Z7 -Xcompiler -Ob0 -Xcompiler -Od -Xcompiler -RTC1' 'LDFLAGS=-Xlinker -Xlinker -Xlinker -LIBPATH:D:/dev/vcpkg/installed/x64-windows/debug/lib -Xlinker -Xlinker -Xlinker -LIBPATH:D:/dev/vcpkg/installed/x64-windows/debug/lib/manual-link -Xlinker -Xlinker -Xlinker -machine:x64 -Xlinker -Xlinker -Xlinker -nologo -Xlinker -Xlinker -Xlinker -debug -Xlinker -Xlinker -Xlinker -INCREMENTAL' 'LIBS=-lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -lcomdlg32 -ladvapi32' 'CPPFLAGS=-DWIN32 -D_WINDOWS -D_DEBUG' 'CXX=compile cl.exe' 'CXXFLAGS=-Xcompiler -nologo -Xcompiler -W3 -Xcompiler -utf-8 -Xcompiler -GR -Xcompiler -EHsc -Xcompiler -MP -Xcompiler -MDd -Xcompiler -Z7 -Xcompiler -Ob0 -Xcompiler -Od -Xcompiler -RTC1' 'CPP=compile cl.exe -E' 'PKG_CONFIG=D:/dev/vcpkg/downloads/tools/msys2/d33df895d441a36d/mingw64/bin/pkg-config.exe' 'PKG_CONFIG_PATH=D:/dev/vcpkg/packages/libpq_x64-windows/debug/lib/pkgconfig;D:/dev/vcpkg/packages/libpq_x64-windows/share/pkgconfig;D:/dev/vcpkg/installed/x64-windows/debug/lib/pkgconfig;D:/dev/vcpkg/installed/x64-windows/share/pkgconfig'" #define PG_MAJORVERSION "16" #define PG_MAJORVERSION_NUM 16 #define PG_MINORVERSION_NUM 2 #define PG_VERSION "16.2" #define DEF_PGPORT 5432 #define DEF_PGPORT_STR "5432" #define BLCKSZ 8192 #define RELSEG_SIZE 131072 #define XLOG_BLCKSZ 8192 configure: exit 1 ```
WangWeiLin-MV commented 5 months ago

Please use Developer Command Prompt for VS 2022 and try again.

diphdawuqi commented 5 months ago

Please use Developer Command Prompt for VS 2022 and try again.

I tested it and got the same result, but I did not use the vcpkg that comes with VS2022. Instead, I obtained one from GitHub. Does this matter?

I have got the warning:

warning: The vcpkg D:\dev\vcpkg\vcpkg.exe is using detected vcpkg root D:\dev\vcpkg and ignoring mismatched VCPKG_ROOT environment value d:\Program Files\Microsoft Visual Studio\2022\Community\VC\vcpkg. To suppress this message, unset the environment variable or use the --vcpkg-root command line switch.
WangWeiLin-MV commented 5 months ago

The local build passed of command vcpkg install gdal:x64-windows, please run bootstrap-vcpkg.bat to update vcpkg.exe and try again.

diphdawuqi commented 5 months ago

The local build passed of command vcpkg install gdal:x64-windows, please run bootstrap-vcpkg.bat to update vcpkg.exe and try again.

I deleted the entire vcpkg and the local msys2, reinstalled vcpkg, and it seems to be working now, although I still don't understand what the issue was.