Alcaro / Flips

Floating IPS is a patcher for IPS and BPS files.
Other
334 stars 46 forks source link

MSVC: `strings.h` not found on Windows #76

Closed Miepee closed 4 months ago

Miepee commented 4 months ago

MSVC complains about this import: https://github.com/Alcaro/Flips/blob/7a5d55cc6c97a6f13d137c46253bfe25fb7d2914/flips.h#L66

Out of my expertise to know what exactly is used from that import and what the workaround would be.

Alcaro commented 4 months ago

I don't know either. It's not part of the C++ standard, so it shouldn't be included in the CLI interface at all.

Let's just nuke it and see what happens.

Miepee commented 4 months ago

Now MVSC complains about this: D:/a/Flips/Flips/flips.cpp(904): error C3861: 'strcasecmp': identifier not found D:/a/Flips/Flips/flips.cpp(1426): error C3861: 'strcasecmp': identifier not found

Alcaro commented 4 months ago

oh right, that function isn't standard C++ either.

Ideally, I'd reimplement that function using only standard functions, but... eh, this is good enough.

Alcaro commented 4 months ago

stalks your fork's actions panel

flips-w32.obj : error LNK2019: unresolved external symbol __imp_CreateFontA referenced in function "struct HFONT__ * __cdecl try_create_font(char const *,int)" (?try_create_font@@YAPEAUHFONT__@@PEBDH@Z) flips-w32.obj : error LNK2019: unresolved external symbol __imp_GetStockObject referenced in function "__int64 __cdecl bpsdProgressWndProc(struct HWND__ *,unsigned int,unsigned __int64,__int64)" (?bpsdProgressWndProc@@YA_JPEAUHWND__@@I_K_J@Z) flips-w32.obj : error LNK2019: unresolved external symbol __imp_SelectObject referenced in function "__int64 __cdecl bpsdProgressWndProc(struct HWND__ *,unsigned int,unsigned __int64,__int64)" (?bpsdProgressWndProc@@YA_JPEAUHWND__@@I_K_J@Z)

Those aren't bugs in Flips. They're because MSVC ignored the -lgdi32 -lcomdlg32 -lcomctl32 etc arguments.

You'll need to pass in the MSVC equivalent. I think it should be gdi32.lib comdlg32.lib comctl32.lib etc? Maybe you could set $env:CXX='cl.exe gdi32.lib comdlg32.lib comctl32.lib etc'?