OS: Windows 10 64-bit
Environment: MSYS2/MinGW-w64 Geany source: f0e3ee273e67387f85506ea629b9dbe34d47b8ca
My compiler complains that the `alloca.h` header is missing.
``` FAILED: libregex.a.p/ctags_gnu_regex_regex.c.obj "cc" "-Ilibregex.a.p" "-I." "-I.." "-I../ctags/fnmatch" "-fdiagnostics-color=always" "-D_FILE_OFFSET_BITS=64" "-Wall" "-Winvalid-pch" "-std=c11" "-O3 " "-DHAVE_CONFIG_H=1" "-O2" "-D__USE_GNU" -MD -MQ libregex.a.p/ctags_gnu_regex_regex.c.obj -MF "libregex.a.p/ctags_gnu_regex_regex.c.obj.d" -o libreg ex.a.p/ctags_gnu_regex_regex.c.obj "-c" ../ctags/gnu_regex/regex.c In file included from ../ctags/gnu_regex/regex.c:61: ../ctags/gnu_regex/regex_internal.h:424:11: fatal error: alloca.h: No such file or directory 424 | # include <alloca.h> | ^~~~~~~~~~ compilation terminated. ```
According to [this answer on SO](https://stackoverflow.com/a/58286937/4677917), `alloca.h` does not exist in Windows & should be replaced with `malloh.h`.
I haven't tested it yet. Wanted to get the report posted.
My local MSYS2 setup on a native Windows system does *not* have `alloca.h` nor does the CI build image has it (https://github.com/geany/infrastructure/pkgs/container/geany-mingw64-ci) and both cleanly build Geany.
How do you start your build? Is the `gcc` command you posted above the same which is used to build Geany?
Just in case you didn't know, there is a howto on https://wiki.geany.org/howtos/win32/msys2 to assist in building Geany with MSYS2.
@eht16 Thanks for the response. I switched to GNU Autotools & the build succeeded. I didn't realize that building with Meson is still experimental.
Is the gcc command you posted above the same which is used to build Geany?
I'll have to do some digging to make sure.
According to the [Meson log](https://github.com/geany/geany/files/11058531/meson-log.txt), it's calling `cc`, which I believe is just a copy of the `gcc` executable:
``` $ which cc /mingw64/bin/cc
$ ls -l /mingw64/bin/[^g]*cc.exe -rwxr-xr-x 1 antum antum 2350907 Jan 23 00:22 /mingw64/bin/x86_64-w64-mingw32-cc.exe -rwxr-xr-x 1 antum antum 2350907 Jan 23 00:22 /mingw64/bin/x86_64-w64-mingw32-gcc.exe ```
It also defines `WIN32` as `1`.
That you are using Meson is an important bit of information.
I can reproduce the error when using Meson on Windows/MSYS2. And this is because our Meson setup does *not* `WIN32`.
The following patch defines it and the build succeeds: ```diff diff --git a/meson.build b/meson.build index 6944a423b..bf725bd9b 100644 --- a/meson.build +++ b/meson.build @@ -202,6 +202,10 @@ if (gnu_source) basic_cflags += '-D_GNU_SOURCE' endif
+if host_machine.system() == 'windows' + basic_cflags += '-DWIN32=1' +endif + # CFLAGS common between Geany and bundled plugins def_cflags = basic_cflags + [ '-DGTK', ```
This raises two questions, mainly targeted to @kugel-: - why did this not fail in the past when we tested Meson support on Windows? - is there a better way or place in `meson.build` to add the define?
That you are using Meson is an important bit of information.
My apologies for not being clear. When I opened this, I thought meson was the recommended build tool.
github-comments@lists.geany.org