Opened 4 years ago
Closed 4 years ago
#4877 closed defect (fixed)
PostgreSQL 14 / windows mingw64 can't compile PostGIS
Reported by: | robe | Owned by: | robe |
---|---|---|---|
Priority: | blocker | Milestone: | PostGIS 3.1.2 |
Component: | postgis | Version: | master |
Keywords: | windows, mingw64 | Cc: |
Description
In trying to troubleshoot #4876 I seem to have run into another issue which seems windows/mingw specific which prevents me from being able to even compile, though my PostgreSQL 14 installed fine.
NG64~1/projects/POSTGR~1/rel/PG14W6~1/include/server/port/win32 -DWIN32_STACK_RLIMIT=4194304 -c -o lwgeom_in_gml.o lwgeom_in_gml.c In file included from C:/MING64~1/projects/POSTGR~1/rel/PG14W6~1/include/server/port.h:26, from C:/MING64~1/projects/POSTGR~1/rel/PG14W6~1/include/server/c.h:1355, from C:/MING64~1/projects/POSTGR~1/rel/PG14W6~1/include/server/postgres.h:4 6, from lwgeom_in_gml.c:55: C:/MING64~1/projects/POSTGR~1/rel/PG14W6~1/include/server/port/win32_port.h:57:14: warning: 'struct microsoft_native_stat' declared inside parameter list will not be visible outside of this definition or declaration #define stat microsoft_native_stat ^~~~~~~~~~~~~~~~~~~~~ C:/MING64~1/projects/POSTGR~1/rel/PG14W6~1/include/server/port/win32_port.h:57:14: warning: 'struct microsoft_native_stat' declared inside parameter list will not be visible outside of this definition or declaration #define stat microsoft_native_stat ^~~~~~~~~~~~~~~~~~~~~ C:/MING64~1/projects/POSTGR~1/rel/PG14W6~1/include/server/port/win32_port.h:57:14: warning: 'struct microsoft_native_stat' declared inside parameter list will not be visible outside of this definition or declaration #define stat microsoft_native_stat ^~~~~~~~~~~~~~~~~~~~~ C:/MING64~1/projects/POSTGR~1/rel/PG14W6~1/include/server/port/win32_port.h:57:14: warning: 'struct microsoft_native_stat' declared inside parameter list will not be visible outside of this definition or declaration #define stat microsoft_native_stat ^~~~~~~~~~~~~~~~~~~~~ C:/MING64~1/projects/POSTGR~1/rel/PG14W6~1/include/server/port/win32_port.h:56:15: error: co nflicting types for 'microsoft_native_fstat' #define fstat microsoft_native_fstat ^~~~~~~~~~~~~~~~~~~~~~ C:/MING64~1/projects/POSTGR~1/rel/PG14W6~1/include/server/port/win32_port.h:56:15: note: pre vious declaration of 'microsoft_native_fstat' was here #define fstat microsoft_native_fstat ^~~~~~~~~~~~~~~~~~~~~~ In file included from C:/MING64~1/projects/POSTGR~1/rel/PG14W6~1/include/server/port/win32_p ort.h:58, from C:/MING64~1/projects/POSTGR~1/rel/PG14W6~1/include/server/port.h:26, from C:/MING64~1/projects/POSTGR~1/rel/PG14W6~1/include/server/c.h:1355, from C:/MING64~1/projects/POSTGR~1/rel/PG14W6~1/include/server/postgres.h:4 6, from lwgeom_in_gml.c:55: C:/ming64gcc81/mingw64/x86_64-w64-mingw32/include/sys/stat.h: In function 'microsoft_native_ fstat': C:/ming64gcc81/mingw64/x86_64-w64-mingw32/include/sys/stat.h:226:27: error: invalid applicat ion of 'sizeof' to incomplete type 'struct microsoft_native_stat' memset(_Stat,0,sizeof(struct stat)); ^~~~~~ C:/ming64gcc81/mingw64/x86_64-w64-mingw32/include/sys/stat.h:231:8: error: dereferencing poi nter to incomplete type 'struct microsoft_native_stat' _Stat->st_dev=st.st_dev; ^~ In file included from C:/MING64~1/projects/POSTGR~1/rel/PG14W6~1/include/server/port.h:26, from C:/MING64~1/projects/POSTGR~1/rel/PG14W6~1/include/server/c.h:1355, from C:/MING64~1/projects/POSTGR~1/rel/PG14W6~1/include/server/postgres.h:4 6, from lwgeom_in_gml.c:55: C:/MING64~1/projects/POSTGR~1/rel/PG14W6~1/include/server/port/win32_port.h: At top level: C:/MING64~1/projects/POSTGR~1/rel/PG14W6~1/include/server/port/win32_port.h:256:8: error: re definition of 'struct stat' struct stat /* This should match struct __stat64 */ ^~~~ In file included from C:/ming64gcc81/mingw64/x86_64-w64-mingw32/include/wchar.h:424, from C:/ming64gcc81/projects/rel-libiconv-1.15w64gcc81/include/iconv.h:110, from C:/ming64gcc81/projects/libxml/rel-libxml2-2.9.9w64gcc81/include/libxm l2/libxml/encoding.h:28, from C:/ming64gcc81/projects/libxml/rel-libxml2-2.9.9w64gcc81/include/libxm l2/libxml/parser.h:810, from C:/ming64gcc81/projects/libxml/rel-libxml2-2.9.9w64gcc81/include/libxm l2/libxml/globals.h:18, from C:/ming64gcc81/projects/libxml/rel-libxml2-2.9.9w64gcc81/include/libxm l2/libxml/threads.h:35, from C:/ming64gcc81/projects/libxml/rel-libxml2-2.9.9w64gcc81/include/libxm l2/libxml/xmlmemory.h:218, from C:/ming64gcc81/projects/libxml/rel-libxml2-2.9.9w64gcc81/include/libxm l2/libxml/tree.h:1307, from lwgeom_in_gml.c:50: C:/ming64gcc81/mingw64/x86_64-w64-mingw32/include/_mingw_stat64.h:43:10: note: originally de fined here struct stat { ^~~~ make[1]: *** [<builtin>: lwgeom_in_gml.o] Error 1 make[1]: Leaving directory '/projects/postgis/postgis-git/postgis' make: *** [GNUmakefile:22: all] Error 1
Change History (7)
comment:1 by , 4 years ago
comment:2 by , 4 years ago
Summary: | PostgreSQL 14 / windows can't compile PostGIS → PostgreSQL 14 / windows mingw64 can't compile PostGIS |
---|
comment:3 by , 4 years ago
Milestone: | PostGIS 3.2.0 → PostGIS PostgreSQL |
---|
comment:4 by , 4 years ago
comment:5 by , 4 years ago
Milestone: | PostGIS PostgreSQL → PostGIS 3.1.2 |
---|
Note:
See TracTickets
for help on using tickets.
Seems they introduced this line in include/server/port/win32_port.h which is conflicting with mingw64 definition. Might be my mingw is old and shouldn't have it defined or they should have a mingw64 guard around this like they have other sections of the win32_port.h
also
I put a
guard around these sections that allowed me to compile. I'll report as possible bug upstream.