I'm using MSYS2 as recommended by: https://wiki.geany.org/howtos/win32/msys2. Building git master. ``` $ gcc --version gcc (GCC) 7.4.0 ``` `make V=1` gives: ``` depbase=`echo tm_source_file.lo | sed 's|[^/]*$|.deps/&|;s|.lo$||'`;\ /bin/sh ../../libtool --silent --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../.. -I. -I../../ctags/main -DGEANY_PRIVATE -DG_LOG_DOMAIN="Tagmanager" -mms-bitfields -pthread -mms-bitfields -I/mingw32/include/gtk-2.0 -I/mingw32/lib/gtk-2.0/include -I/mingw32/include/pango-1.0 -I/mingw32/include/fribidi -I/mingw32/include -I/mingw32/include/cairo -I/mingw32/include/atk-1.0 -I/mingw32/include/cairo -I/mingw32/include/pixman-1 -I/mingw32/include -I/mingw32/include/freetype2 -I/mingw32/include -I/mingw32/include/harfbuzz -I/mingw32/include -I/mingw32/include/libpng16 -I/mingw32/include/gdk-pixbuf-2.0 -I/mingw32/include/libpng16 -I/mingw32/include -I/mingw32/lib/libffi-3.2.1/include -I/mingw32/include -I/mingw32/include/glib-2.0 -I/mingw32/lib/glib-2.0/include -I/mingw32/include -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32 -fvisibility=hidden -DGEANY_EXPORT_SYMBOL="__attribute__((visibility("default")))" -DGEANY_API_SYMBOL=GEANY_EXPORT_SYMBOL -g -DGEANY_DEBUG -g -O0 -MT tm_source_file.lo -MD -MP -MF $depbase.Tpo -c -o tm_source_file.lo tm_source_file.c &&\ mv -f $depbase.Tpo $depbase.Plo tm_source_file.c:91:14: error: static declaration of ‘realpath’ follows non-static declaration static char *realpath (const char *pathname, char *resolved_path) ^~~~~~~~ In file included from tm_source_file.c:20:0: /usr/include/stdlib.h:151:8: note: previous declaration of ‘realpath’ was here char * realpath (const char *__restrict path, char *__restrict resolved_path); ^~~~~~~~ make[3]: *** [Makefile:505: tm_source_file.lo] Error 1 make[3]: Leaving directory '/c/git/geany/src/tagmanager' ```
We should probably add [a proper Autoconf check](https://github.com/geany/geany/blob/46d5e7542b8396ed593f2e319f71d153a67684dc...) for `realpath` if mingw's newlib activates it for windows.
As a possible workaround, you could try [updating your msys2](https://wiki.archlinux.org/index.php/pacman#Upgrading_packages), judging by the GCC version, it's rather out of date.
As a possible workaround, you could try updating your msys2, judging by the GCC version, it's rather out of date.
Done.
I added realpath to AC_CHECK_FUNCS in the referenced pull but it doesn't define HAVE_REALPATH in config.h, what am I doing wrong?
My gcc is now: gcc version 9.1.0 (GCC)
OK, so after running make I do now get HAVE_REALPATH.
This is strange. It doesn't happen in my MSYS2 installation. I'm wondering why your gcc is considering `/usr/include/stdlib.h` and so get confused about the `realpath` definition.
I think the proper location of the header is `/msys64/mingw32/i686-w64-mingw32/include/stdlib.h` and there is also no definition of `realpth` and so no problem.
``` $ gcc --version gcc.exe (Rev1, Built by MSYS2 project) 9.2.0 ... depbase=`echo tm_source_file.lo | sed 's|[^/]*$|.deps/&|;s|.lo$||'`;\ /bin/sh ../../libtool --silent --tag=CC --mode=compile ccache gcc -DHAVE_CONFIG_H -I. -I../.. -I. -I../../ctags/main -DGEANY_PRIVATE -DG_LOG_DOMAIN="Tagmanager" -mms-bitfields -pthread -mms-bitfields -IC:/msys64/mingw32/include/gtk-2.0 -IC:/msys64/mingw32/lib/gtk-2.0/include -IC:/msys64/mingw32/include/pango-1.0 -IC:/msys64/mingw32/include/fribidi -IC:/msys64/mingw32/include -IC:/msys64/mingw32/include/cairo -IC:/msys64/mingw32/include/atk-1.0 -IC:/msys64/mingw32/include/cairo -IC:/msys64/mingw32/include/pixman-1 -IC:/msys64/mingw32/include -IC:/msys64/mingw32/include/freetype2 -IC:/msys64/mingw32/include -IC:/msys64/mingw32/include/harfbuzz -IC:/msys64/mingw32/include/libpng16 -IC:/msys64/mingw32/include/gdk-pixbuf-2.0 -IC:/msys64/mingw32/include/libpng16 -IC:/msys64/mingw32/include -IC:/msys64/mingw32/lib/libffi-3.2.1/include -IC:/msys64/mingw32/include -IC:/msys64/mingw32/include/glib-2.0 -IC:/msys64/mingw32/lib/glib-2.0/include -IC:/msys64/mingw32/include -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32 -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGEANY_EXPORT_SYMBOL="__declspec(dllexport)" -DGEANY_API_SYMBOL=GEANY_EXPORT_SYMBOL -g -DGEANY_DEBUG -g -O2 -MT tm_source_file.lo -MD -MP -MF $depbase.Tpo -c -o tm_source_file.lo tm_source_file.c &&\ mv -f $depbase.Tpo $depbase.Plo ```
Thanks for the info @eht16. Yes I also have errors with spawn, that might be the problem. I'll check this on Monday. So should we merge the pull for this issue or not?
Well, let's first check the source of the problem to know if it is in your local setup, in my local setup or if it is actually a real issue.
OK, I have now fixed my setup thanks to @eht16. The problem was I had installed a pacman package called `gcc`, then I installed `mingw-w64-i686-gcc` as well as written on the wiki page. This was very confusing. I removed gcc, reinstalled mingw-w64-i686-gcc, then I had to close MSYS2 and restart. Now I can build tm_source_file.c and spawn.c fine :-D
Closed #2261 via #2263.
github-comments@lists.geany.org