Skip to content

UCRT64 builds of readstat 1.1.9 fail #300

@JorisGoosen

Description

@JorisGoosen

Using RTools42 to compile on Windows gives the following error during compilation:

  CC       src/spss/libreadstat_la-readstat_zsav_read.lo
  CC       src/spss/libreadstat_la-readstat_zsav_write.lo
In file included from D:/rtools42/ucrt64/include/unistd.h:11,
                 from src/readstat_io_unistd.c:12:
D:/rtools42/ucrt64/include/process.h:196:28: error: conflicting types for 'spawnv'; have 'intptr_t(int,  const char *, char * const*)' {aka 'long long int(int,  const char *, char * const*)'}
  196 |   _CRTIMP intptr_t __cdecl spawnv(int,const char *_Filename,char *const _ArgList[]) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
      |                            ^~~~~~
<command-line>: note: previous declaration of 'spawnv' with type 'intptr_t(int,  const char *, const char * const*)' {aka 'long long int(int,  const char *, const char * const*)'}
make: *** [Makefile:2096: src/libreadstat_la-readstat_io_unistd.lo] Error 1
make: *** Waiting for unfinished jobs....
In file included from D:/rtools42/ucrt64/include/unistd.h:11,
                 from D:/rtools42/ucrt64/include/zconf.h:488,
                 from D:/rtools42/ucrt64/include/zlib.h:34,
                 from src/spss/readstat_sav_write.c:25:
D:/rtools42/ucrt64/include/process.h:196:28: error: conflicting types for 'spawnv'; have 'intptr_t(int,  const char *, char * const*)' {aka 'long long int(int,  const char *, char * const*)'}
  196 |   _CRTIMP intptr_t __cdecl spawnv(int,const char *_Filename,char *const _ArgList[]) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
      |                            ^~~~~~
<command-line>: note: previous declaration of 'spawnv' with type 'intptr_t(int,  const char *, const char * const*)' {aka 'long long int(int,  const char *, const char * const*)'}
make: *** [Makefile:2285: src/spss/libreadstat_la-readstat_sav_write.lo] Error 1
In file included from D:/rtools42/ucrt64/include/unistd.h:11,
                 from D:/rtools42/ucrt64/include/zconf.h:488,
                 from D:/rtools42/ucrt64/include/zlib.h:34,
                 from src/spss/readstat_zsav_compress.c:2:
D:/rtools42/ucrt64/include/process.h:196:28: error: conflicting types for 'spawnv'; have 'intptr_t(int,  const char *, char * const*)' {aka 'long long int(int,  const char *, char * const*)'}
  196 |   _CRTIMP intptr_t __cdecl spawnv(int,const char *_Filename,char *const _ArgList[]) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
      |                            ^~~~~~
<command-line>: note: previous declaration of 'spawnv' with type 'intptr_t(int,  const char *, const char * const*)' {aka 'long long int(int,  const char *, const char * const*)'}
In file included from D:/rtools42/ucrt64/include/unistd.h:11,
                 from D:/rtools42/ucrt64/include/zconf.h:488,
                 from D:/rtools42/ucrt64/include/zlib.h:34,
                 from src/spss/readstat_zsav_read.c:2:
D:/rtools42/ucrt64/include/process.h:196:28: error: conflicting types for 'spawnv'; have 'intptr_t(int,  const char *, char * const*)' {aka 'long long int(int,  const char *, char * const*)'}
  196 |   _CRTIMP intptr_t __cdecl spawnv(int,const char *_Filename,char *const _ArgList[]) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
      |                            ^~~~~~
<command-line>: note: previous declaration of 'spawnv' with type 'intptr_t(int,  const char *, const char * const*)' {aka 'long long int(int,  const char *, const char * const*)'}
In file included from D:/rtools42/ucrt64/include/unistd.h:11,
                 from D:/rtools42/ucrt64/include/zconf.h:488,
                 from D:/rtools42/ucrt64/include/zlib.h:34,
                 from src/spss/readstat_zsav_write.c:3:
D:/rtools42/ucrt64/include/process.h:196:28: error: conflicting types for 'spawnv'; have 'intptr_t(int,  const char *, char * const*)' {aka 'long long int(int,  const char *, char * const*)'}
  196 |   _CRTIMP intptr_t __cdecl spawnv(int,const char *_Filename,char *const _ArgList[]) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
      |                            ^~~~~~
<command-line>: note: previous declaration of 'spawnv' with type 'intptr_t(int,  const char *, const char * const*)' {aka 'long long int(int,  const char *, const char * const*)'}
make: *** [Makefile:2397: src/spss/libreadstat_la-readstat_zsav_write.lo] Error 1
make: *** [Makefile:2383: src/spss/libreadstat_la-readstat_zsav_compress.lo] Error 1
make: *** [Makefile:2390: src/spss/libreadstat_la-readstat_zsav_read.lo] Error 1

We simply change:

[*mingw*], [CFLAGS="$CFLAGS -D_spawnv=spawnv"],

to:

[*mingw*], [CFLAGS="$CFLAGS"],

Maybe the -D_spawnv=spawnv is just for the older c++-runtime of msvc used in the older mingw?
Not sure if there is a way to distinguish both versions of mingw here though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions