JayXon / Leanify

lightweight lossless file minifier/optimizer
MIT License
832 stars 75 forks source link

Fix undefined reference to PathRemoveFileSpec() #71

Closed ghost closed 3 years ago

ghost commented 3 years ago

On Windows, compiling with MinGW produces undefined reference to ::PathRemoveFileSpecW() due to not being linked to shlwapi. This patch fixes that.

> mingw32-make -f Makefile -j4
E:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\Florastamine\AppData\Local\Temp\leanify.exe.8FLneM.ltrans9.ltrans.o:<artificial>:(.text+0xdb3): undefined reference to `__imp_PathRemoveFileSpecW'
collect2.exe: error: ld returned 1 exit status
mingw32-make: *** [Makefile:43: leanify] Error 1

Tested on gcc (Rev9, Built by MSYS2 project) 10.2.0, but I've seen this issue from as early as 7.1.

JayXon commented 3 years ago

Thanks, I should set up CI for this...