In the git repository, windows build fails.
gcc -c -m64 -O2 -pipe -DUNICODE -D_UNICODE -Wno-unused-function -DGNUPLOT_PS_DIR=\"share/PostScript\" -I. -I../../src -I../../term/ -DHAVE_CONFIG_H -D__USE_MINGW_ANSI_STDIO=1 -DWITH_CHI_SHAPES=1 -DGNUPLOT_SHARE_DIR=\"share\" -DDEVELOPMENT_VERSION -DUSE_MOUSE=1 -DWIN_IPC -I/c/Program\ Files\ (x86)/HTML\ Help\ Workshop/include -DHAVE_LIBGD -DHAVE_LIBPNG -DHAVE_LIBGD -DHAVE_GD_H -DHAVE_GD_GIF -DGIF_ANIMATION -DHAVE_GD_PNG -IC:/Programs/msys64/mingw64/include/X11 -IC:/Programs/msys64/mingw64/include/webp -DLIBDEFLATE_DLL -IC:/Programs/msys64/mingw64/include/freetype2 -IC:/Programs/msys64/mingw64/include/libpng16 -IC:/Programs/msys64/mingw64/include/harfbuzz -IC:/Programs/msys64/mingw64/include/glib-2.0 -IC:/Programs/msys64/mingw64/lib/glib-2.0/include -DHAVE_GD_JPEG -DHAVE_GD_TTF -DHAVE_CAIROPDF -DHAVE_WEBP -DWXWIDGETS -DQTTERM -DQT_NO_OPENGL -DHAVE_LUA -DHAVE_ICONV -DHAVE_LIBCERF -DNEED_CEXP -DHAVE_AMOS -DREADLINE -DUSE_WATCHPOINTS -DUSE_POLAR_GRID -DUSE_FUNCTIONBLOCKS -DWITH_STABLE_SORT -DHAVE_D2D11 -DPIPES -MMD -MT 'winmain.o' -MF winmain.d -o winmain.o ../../src/win/winmain.c
../../src/win/winmain.c: In function 'appdata_directory':
../../src/win/winmain.c:287:14: error: too many arguments to function 'pSHGetSpecialFolderPath'; expected 0, have 4
287 | (*pSHGetSpecialFolderPath)(NULL, dir, CSIDL_APPDATA, FALSE);
| ~^~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~
make: *** [Makefile:679: winmain.o] Error 1
Is it possible you have a new C compiler?
The very recent gcc15 release has made a number of issues that used to be warnings into errors instead. This is apparently because of stricter requirements in the C23 standard. So if the error is from gcc15 you might be able to avoid it by adding the compiler flag
-std=gnu17
Or they might fix this in gcc. See
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118112
Last edit: Ethan Merritt 2025-05-07
Addtion of -std=gnu17 option to CFLAGS eliminates the issue.
Thanks!
Based on this Microsoft page
https://learn.microsoft.com/en-us/cpp/build/getprocaddress?view=msvc-170
I think the correct fix is to provide a full prototype for the function.
Can you test the attached patch?
Testted but an error appears
Ugh. One more try. If this one doesn't work I will have to leave it to someone more familiar with Windows programming.
The 2nd patch solves the issue. Thanks!