Skip to content

Compiling under windows mingw64 #122

Closed
@robe2

Description

@robe2

I tried compiling master under mingw64 with PG16 and ran into some issues.

In file included from src/sparse.c:136:
src/sparse.h:69:5: error: 'INT' redeclared as different kind of symbol
   69 |     INT = 270,                     /* INT  */
      |     ^~~
In file included from C:/ming64/mingw64/include/minwindef.h:163,
                 from C:/ming64/mingw64/include/windef.h:9,
                 from C:/ming64/mingw64/include/windows.h:69,
                 from C:/ming64/mingw64/include/winsock2.h:23,
                 from C:/ming64/projects/POSTGR~1/rel/pg16w64/include/server/port/win32_port.h:60,
                 from C:/ming64/projects/POSTGR~1/rel/pg16w64/include/server/port.h:24,
                 from C:/ming64/projects/POSTGR~1/rel/pg16w64/include/server/c.h:1375,
                 from C:/ming64/projects/POSTGR~1/rel/pg16w64/include/server/postgres.h:45,
                 from src/sparse.y:4:
C:/ming64/mingw64/include/winnt.h:299:15: note: previous declaration of 'INT' with type 'INT' {aka 'int'}
  299 |   typedef int INT;
      |               ^~~
src/sparse.h:70:5: error: 'FLOAT' redeclared as different kind of symbol
   70 |     FLOAT = 271,                   /* FLOAT  */
      |     ^~~~~
C:/ming64/mingw64/include/minwindef.h:142:17: note: previous declaration of 'FLOAT' with type 'FLOAT' {aka 'float'}
  142 |   typedef float FLOAT;
      |                 ^~~~~
make: *** [<builtin>: src/sparse.o] Error 1
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compatible-local -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -O2 -DPGSPHERE_VERSION=1.4.0 -fvisibility=hidden -DPGSPHERE_VERSION=1.4.0 -I. -I./ -IC:/ming64/projects/POSTGR~1/rel/pg16w64/include/server -IC:/ming64/projects/POSTGR~1/rel/pg16w64/include/internal  -I/projects/zlib/rel-zlib-1.2.13w64/include  -I/projects/libxml/rel-libxml2-2.9.14w64/include -I./src/include/port/win32 -IC:/ming64/mingw64/bin/../include/libxml2 -IC:/ming64/projects/lz4/rel-lz4-1.9.3w64/include  -IC:/ming64/projects/POSTGR~1/rel/pg16w64/include/server/port/win32 -DWIN32_STACK_RLIMIT=4194304  -c -o src/sparse.o src/sparse.c
In file included from src/sparse.c:136:
src/sparse.h:69:5: error: 'INT' redeclared as different kind of symbol
   69 |     INT = 270,                     /* INT  */
      |     ^~~
In file included from C:/ming64/mingw64/include/minwindef.h:163,
                 from C:/ming64/mingw64/include/windef.h:9,
                 from C:/ming64/mingw64/include/windows.h:69,
                 from C:/ming64/mingw64/include/winsock2.h:23,
                 from C:/ming64/projects/POSTGR~1/rel/pg16w64/include/server/port/win32_port.h:60,
                 from C:/ming64/projects/POSTGR~1/rel/pg16w64/include/server/port.h:24,
                 from C:/ming64/projects/POSTGR~1/rel/pg16w64/include/server/c.h:1375,
                 from C:/ming64/projects/POSTGR~1/rel/pg16w64/include/server/postgres.h:45,
                 from src/sparse.y:4:
C:/ming64/mingw64/include/winnt.h:299:15: note: previous declaration of 'INT' with type 'INT' {aka 'int'}
  299 |   typedef int INT;
      |               ^~~
src/sparse.h:70:5: error: 'FLOAT' redeclared as different kind of symbol
   70 |     FLOAT = 271,                   /* FLOAT  */
      |     ^~~~~
C:/ming64/mingw64/include/minwindef.h:142:17: note: previous declaration of 'FLOAT' with type 'FLOAT' {aka 'float'}
  142 |   typedef float FLOAT;

If I remark out the lines 69 and 70 of sparse.h then it compiles and extension installs and tests pass.

make USE_HEALPIX=0
make installcheck USE_HEALPIX=0
ok 1         - init                                      198 ms
ok 2         - tables                                    870 ms
ok 3         - points                                     45 ms
ok 4         - euler                                      35 ms
ok 5         - circle                                     44 ms
ok 6         - line                                       34 ms
ok 7         - ellipse                                    58 ms
ok 8         - poly                                       99 ms
ok 9         - path                                       49 ms
ok 10        - box                                        71 ms
ok 11        - index                                     148 ms
ok 12        - contains_ops                               61 ms
ok 13        - contains_ops_compat                        58 ms
ok 14        - bounding_box_gist                          58 ms
ok 15        - gnomo                                      50 ms
ok 16        - epochprop                                  33 ms
ok 17        - contains                                   38 ms
ok 18        - overlaps                                   54 ms
ok 19        - spoint_brin                                43 ms
ok 20        - sbox_brin                                  51 ms
ok 21        - selectivity                               685 ms
ok 22        - gist_support                              556 ms
1..22
# All 22 tests passed.

Note the Token Kinds section I didn't need to touch. Not sure what I am missing here.

I haven't tried yet compiling with HEALPIX

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions