nbarkhina / numero

TI-83 Emulator for Libretro
Other
8 stars 5 forks source link

Does not compile with msys2 #3

Closed gouchi closed 1 year ago

gouchi commented 1 year ago

Hi,

I don't know if msys2 is supported for building on Windows ?

make or make platform=win` ``` g++ -DGIT_VERSION=\"" 57d2a75"\" -O2 -DNDEBUG -fno-exceptions -fno-rtti -std=c++98 -DHAVE_STDINT_H -D__LIBRETRO__ -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DVIDEO_RGB565 -DHAVE_NETWORK -Ilibnumero/src/../../common -Ilibnumero/src/../libretro -Ilibnumero/src/../libretro-common/include -Ilibnumero/src/include -Ilibnumero/src/core -Ilibnumero/src/Interface -Ilibnumero/src/hardware -Ilibnumero/src/utilities -c -olibnumero/src/../libretro/libretronew.o libnumero/src/../libretro/libretronew.cpp In file included from libnumero/src/../libretro/libretronew.cpp:36: libnumero/src/include/stdafx.h:33: warning: "setjmp" redefined 33 | #define setjmp _setjmp | In file included from C:/msys64/mingw64/include/c++/12.2.0/csetjmp:42, from libnumero/src/include/stdafx.h:31: C:/msys64/mingw64/include/setjmp.h:239: note: this is the location of the previous definition 239 | # define setjmp(BUF) _setjmp((BUF), __builtin_frame_address (0)) | libnumero/src/include/stdafx.h:41: warning: "MAX_PATH" redefined 41 | #define MAX_PATH 256 | In file included from C:/msys64/mingw64/include/windef.h:9, from C:/msys64/mingw64/include/Windows.h:69, from libnumero/src/include/stdafx.h:13: C:/msys64/mingw64/include/minwindef.h:33: note: this is the location of the previous definition 33 | #define MAX_PATH 260 | libnumero/src/include/stdafx.h:44: warning: "ARRAYSIZE" redefined 44 | #define ARRAYSIZE(z) (sizeof(z)/sizeof((z)[0])) | In file included from C:/msys64/mingw64/include/minwindef.h:163: C:/msys64/mingw64/include/winnt.h:681: note: this is the location of the previous definition 681 | #define ARRAYSIZE(A) RTL_NUMBER_OF_V2(A) | libnumero/src/include/stdafx.h:66: warning: "ZeroMemory" redefined 66 | #define ZeroMemory(dest, size) memset(dest, 0, size) | In file included from C:/msys64/mingw64/include/winbase.h:13, from C:/msys64/mingw64/include/Windows.h:70: C:/msys64/mingw64/include/minwinbase.h:11: note: this is the location of the previous definition 11 | #define ZeroMemory RtlZeroMemory | libnumero/src/include/stdafx.h:68: warning: "StringCbCopy" redefined 68 | #define StringCbCopy(dest, size, source) strcpy(dest, source) | In file included from libnumero/src/include/stdafx.h:29: C:/msys64/mingw64/include/strsafe.h:170: note: this is the location of the previous definition 170 | #define StringCbCopy __MINGW_NAME_AW(StringCbCopy) | libnumero/src/include/stdafx.h:69: warning: "StringCchCopy" redefined 69 | #define StringCchCopy(dest, size, source) strcpy(dest, source) | C:/msys64/mingw64/include/strsafe.h:154: note: this is the location of the previous definition 154 | #define StringCchCopy __MINGW_NAME_AW(StringCchCopy) | libnumero/src/include/stdafx.h:70: warning: "StringCbPrintf" redefined 70 | #define StringCbPrintf(dest, size, format, args) sprintf(dest, format, args) | C:/msys64/mingw64/include/strsafe.h:559: note: this is the location of the previous definition 559 | #define StringCbPrintf __MINGW_NAME_AW(StringCbPrintf) | libnumero/src/../libretro/libretronew.cpp: In function 'void retro_reset()': libnumero/src/../libretro/libretronew.cpp:560:22: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings] 560 | char* rom_name = "ti83se.rom"; | ^~~~~~~~~~~~ libnumero/src/../libretro/libretronew.cpp:562:20: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings] 562 | setProgressDir("ti83se"); | ^~~~~~~~ libnumero/src/../libretro/libretronew.cpp:567:20: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings] 567 | rom_name = "ti83plus.rom"; | ^~~~~~~~~~~~~~ libnumero/src/../libretro/libretronew.cpp:569:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings] 569 | setProgressDir("ti83plus"); | ^~~~~~~~~~ libnumero/src/../libretro/libretronew.cpp:575:20: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings] 575 | rom_name = "ti83.rom"; | ^~~~~~~~~~ libnumero/src/../libretro/libretronew.cpp:577:24: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings] 577 | setProgressDir("ti83"); | ^~~~~~ libnumero/src/../libretro/libretronew.cpp: In function 'void setSaveDir()': libnumero/src/../libretro/libretronew.cpp:621:5: error: 'sprintf_instead_use_StringCbPrintfA_or_StringCchPrintfA' was not declared in this scope 621 | sprintf(savetempdir, "%s", fullpath.c_str()); | ^~~~~~~ libnumero/src/../libretro/libretronew.cpp: In function 'void setProgressDir(char*)': libnumero/src/../libretro/libretronew.cpp:634:5: error: 'sprintf_instead_use_StringCbPrintfA_or_StringCchPrintfA' was not declared in this scope 634 | sprintf(saveprogressdir, "%s", fullpath.c_str()); | ^~~~~~~ libnumero/src/../libretro/libretronew.cpp: In function 'bool retro_load_game(const retro_game_info*)': libnumero/src/../libretro/libretronew.cpp:718:13: error: 'sprintf_instead_use_StringCbPrintfA_or_StringCchPrintfA' was not declared in this scope 718 | sprintf(rom_dir, "%s", info->path); | ^~~~~~~ libnumero/src/../libretro/libretronew.cpp: In function 'void drawScreen()': libnumero/src/../libretro/libretronew.cpp:1009:9: error: 'sprintf_instead_use_StringCbPrintfA_or_StringCchPrintfA' was not declared in this scope 1009 | sprintf(textBuffer, "Please add one of the following rom files to your System Directory"); | ^~~~~~~ make: *** [Makefile.libretro:740: libnumero/src/../libretro/libretronew.o] Error 1 ```

Thank you.

N.B = It seems that numero/resource.h is using UTF-16 LE BOM encoding so I convert it to UTF-8 as it was causing issue for the compilation.

nbarkhina commented 1 year ago

I don't have MSYS2 installed so I will have to test with that. Do you know if there a docker image I can use somewhere with the environment already set up for building with windows so I can test this?

I will fix the resource.h file encoding

Thanks

nbarkhina commented 1 year ago

@gouchi I think I got it, pushed a fix for windows hopefully it builds now. can you please try it again?

gouchi commented 1 year ago

Thank you it is working now !