From: David Mertens
Sent: Monday, April 25, 2016 7:16 AM
To: perl-xs@perl.org
Subject: Help setting up appveyor for Windows continuous integration testing
Hello everyone,

The specific tcc error (given at https://ci.appveyor.com/project/run4flat/c-blocks/build/1.0.17#L47) is:

C:/STRAWB~1/perl/lib/CORE/perl.h:2708: error: ';' expected (got "perl_os_thread")

What does line 2708  of perl.h contain ?
I get a very similar type of error when building C-Blocks-0.03 on Windows (perl-5.16, mingw.org build of gcc-4.7.0):

Building C-Blocks
Creating lib/C/Blocks/PerlAPI.xs
In file included from perl_h_QSJqVkp1.c:15:
In file included from C:/Mingw/perl516/lib/CORE/perl.h:610:
C:/MinGW/include/sys/types.h:27: error: ';' expected (got "__time32_t")

where line 27 is:

typedef __int32 __time32_t;

My first thought was that perl might be doing something incompatible with the __int32 symbol, as there's no problem with a C program that #includes sys/types.h. But #including sys/types.h into an Inline::C script is also fine, so I think it's unlikely that perl is the culprit

Moving on .... I don't get that error when I switch to perl-522, which uses the gcc-4.9.2 compiler provided by mingw-w64 project (different vendor).
Indeed, this compiler doesn't typedef __int32 at all.

However, with this combo, the C-Blocks-0.03 build fails with:

Building C-Blocks
Creating lib/C/Blocks/PerlAPI.xs
In file included from perl_h_Xd9p6ge7.c:15:
In file included from C:/MinGW/perl522_64int/lib/CORE/perl.h:699:
In file included from C:/_32/gcc-straw-492/i686-w64-mingw32/include/sys/types.h:13: In file included from C:/_32/gcc-straw-492/i686-w64-mingw32/include/crtdefs.h:10: In file included from C:/_32/gcc-straw-492/i686-w64-mingw32/include/_mingw.h:275: C:/_32/gcc-straw-492/i686-w64-mingw32/include/vadefs.h:35: error: #error VARARGS not implemented for this compiler
Unable to serialize the header file

The error implies that the symbol  __WIDL__ has not been defined.
It looks to me (not entirely certain) that __WIDL__ is normally *not* defined for me.

Does anybody know what's going on?

Not me.
Note that these errors are being obtained just running "cpan -i C::Blocks". Appveyor is not involved (unless, of course, it's being called in as part of the cpan build).

One other odd thing:
I had to set the CPATH environment variable to the location of winsock2.h - otherwise that header could not be located. In both C and Inline::C scripts that header is in the default search path - and gets #included fine.

Here's the error:

Building C-Blocks
Creating lib/C/Blocks/PerlAPI.xs
In file included from perl_h_Yryks05Z.c:15:
In file included from C:/MinGW/perl522_64int/lib/CORE/perl.h:3060:
In file included from C:/MinGW/perl522_64int/lib/CORE/win32thread.h:4:
C:/MinGW/perl522_64int/lib/CORE/win32.h:131: warning: WIN32_LEAN_AND_MEAN redefined
In file included from perl_h_Yryks05Z.c:15:
In file included from C:/MinGW/perl522_64int/lib/CORE/perl.h:3060:
In file included from C:/MinGW/perl522_64int/lib/CORE/win32thread.h:4:
In file included from C:/MinGW/perl522_64int/lib/CORE/win32.h:419:
C:/MinGW/perl522_64int/lib/CORE/sys/socket.h:21: error: include file 'winsock2.h' not found
Unable to serialize the header file
lib/C/Blocks/PerlAPI.xs.PL failed at C:/MinGW/perl522_64int/site/lib/Module/Build/Base.pm line 2930.

I just noticed that setting CPATH also removes the "WIN32_LEAN_AND_MEAN" redefinition warning. Also, win32.h #includes windows.h - and I *think* (could check if it's important) that should be enough to get winsock2.h #included.
Something is not quite right.

Cheers,
Rob

Reply via email to