Hello,
I am trying to build PG from source, in MS Windows using MSYS2 and MinGW-w64.
I've tried to build PG 10.0 as wells as 10.3.
I've done configuring like this
./configure --prefix="/d/pg10/"
And when I do "make" or "make world", I'm getting compilation error. I've
attached complete error report at the end of the mail.
Basically, one error is pre-processor #error must have a working 64-bit integer
datatype.
Another error is "redifinition of fseeko".
Another error is "FLEXIBLE_ARRAY_MEMBER" is undefined.
I don't know why the error is coming, I tried reinstalling MSYS2 and but still
no luck. Could you please help?
My $PATH var is
$ echo $PATH
/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
$ make make -C src all make[1]: Entering directory
'/d/Insaf/pgSource/postgresql-10.0/src' make -C common all make[2]: Entering
directory '/d/Insaf/pgSource/postgresql-10.0/src/common' make -C ../backend
submake-errcodes make[3]: Entering directory
'/d/Insaf/pgSource/postgresql-10.0/src/backend' make[3]: Nothing to be done for
'submake-errcodes'. make[3]: Leaving directory
'/d/Insaf/pgSource/postgresql-10.0/src/backend' gcc -Wall -Wmissing-prototypes
-Wpointer-arith -Wdeclaration-after-statement -Wendif-labels
-Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv
-fexce ss-precision=standard -O2 -DFRONTEND -I../../src/include
-I./src/include/port/win32 -DEXEC_BACKEND "-I../../src/include/port/win32"
-DBUILDING_DLL -DVAL_CONFIGURE="\"'--p refix=/d/Insaf/pgGcc'
'PKG_CONFIG_PATH=/mingw64/lib/pkgconfig:/mingw64/share/pkgconfig'\""
-DVAL_CC="\"gcc\"" -DVAL_CPPFLAGS="\"-DFRONTEND -I./src/include/port/win32
-DEXEC _BACKEND "-I../../src/include/port/win32" -DBUILDING_DLL\""
-DVAL_CFLAGS="\"-Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissin g-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard
-O2\"" -DVAL_CFLAGS_SL="\"\"" -DVAL_LDFLAGS="\"-L../../src/common -Wl,--allow-
multiple-definition -Wl,--disable-auto-import -Wl,--as-needed\""
-DVAL_LDFLAGS_EX="\"\"" -DVAL_LDFLAGS_SL="\"\"" -DVAL_LIBS="\"-lpgcommon
-lpgport -lz -lws2_32 -lm -lws2_3 2 \"" -c -o base64.o base64.c In file
included from ../../src/include/c.h:48:0, from
../../src/include/postgres_fe.h:25, from base64.c:18:
../../src/include/postgres_ext.h:47:9: error: unknown type name 'PG_INT64_TYPE'
typedef PG_INT64_TYPE pg_int64; ^~~~~~~~~~~~~ In file included from
../../src/include/postgres_fe.h:25:0, from base64.c:18:
../../src/include/c.h:306:2: error: #error must have a working 64-bit integer
datatype #error must have a working 64-bit integer datatype ^~~~~
../../src/include/c.h:446:15: error: 'FLEXIBLE_ARRAY_MEMBER' undeclared here
(not in a function) char vl_dat[FLEXIBLE_ARRAY_MEMBER]; /* Data content is here
*/ ^~~~~~~~~~~~~~~~~~~~~ In file included from
../../src/include/postgres_fe.h:25:0, from base64.c:18:
../../src/include/c.h:1054:1: warning: 'PG_PRINTF_ATTRIBUTE' is an unrecognized
format function type [-Wformat=] extern int snprintf(char *str, size_t count,
const char *fmt,...) pg_attribute_printf(3, 4); ^~~~~~ In file included from
../../src/include/c.h:1129:0, from ../../src/include/postgres_fe.h:25, from
base64.c:18: ../../src/include/port.h:375:0: warning: "fseeko" redefined
#define fseeko(a, b, c) fseek(a, b, c) In file included from
../../src/include/c.h:101:0, from ../../src/include/postgres_fe.h:25, from
base64.c:18: ../../src/include/pg_config_os.h:237:0: note: this is the location
of the previous definition #define fseeko(stream, offset, origin)
fseeko64(stream, offset, origin) In file included from
../../src/include/c.h:1129:0, from ../../src/include/postgres_fe.h:25, from
base64.c:18: ../../src/include/port.h:376:0: warning: "ftello" redefined
#define ftello(a) ftell(a) In file included from ../../src/include/c.h:101:0,
from ../../src/include/postgres_fe.h:25, from base64.c:18:
../../src/include/pg_config_os.h:240:0: note: this is the location of the
previous definition #define ftello(stream) ftello64(stream) In file included
from ../../src/include/postgres_fe.h:27:0, from base64.c:18:
../../src/include/common/fe_memutils.h:41:1: warning: 'PG_PRINTF_ATTRIBUTE' is
an unrecognized format function type [-Wformat=] extern char *psprintf(const
char *fmt,...) pg_attribute_printf(1, 2); ^~~~~~
../../src/include/common/fe_memutils.h:42:1: warning: 'PG_PRINTF_ATTRIBUTE' is
an unrecognized format function type [-Wformat=] extern size_t pvsnprintf(char
*buf, size_t len, const char *fmt, va_list args) pg_attribute_printf(3, 0);
^~~~~~ make[2]: *** [: base64.o] Error 1 make[2]: Leaving directory
'/d/Insaf/pgSource/postgresql-10.0/src/common' make[1]: *** [Makefile:37:
all-common-recurse] Error 2 make[1]: Leaving directory
'/d/Insaf/pgSource/postgresql-10.0/src' make: *** [GNUmakefile:11:
all-src-recurse] Error 2
Regards,
Mohamed Insaf K