Closed bslenul closed 1 year ago
I think#ifdef _WIN32
works, but I'm not familiar with building C/C++ on windows either. But looking at libretro code and a couple other projects, that looks like the right thing to do. At present I don't have a windows machine to check, but I did get the libretro core building on windows at one point and I think what you have described sounds like what I did.
Should I send a PR or you want to test for yourself first and/or find a better alternative maybe?
Found my old branch and pushed it. Does https://github.com/jtothebell/fake-08/tree/libretro-windows work for you? I got it building for someone else and they said it was working, but I don't know how thoroughly it was tested.
#include <cstdint>
(or
edit: and putting that same #ifdef block inside https://github.com/jtothebell/fake-08/blob/libretro-windows/source/filehelpers.h let me build standalone as well, might want to add that too ;)
Alright, I moved that #ifdef block to host.h
since mkdir should only be getting called from host implementations, and that should work for both libretro builds and standalone builds. If that is working, I'll merge that change in.
Yep all good now, both Libretro and standalone!
Thank you! ❤️
@bslenul Can you give me any more details about how you're building with MinGW for windows? I tried today to build the libretro core, and it builds fine, but crashes when I try to load a game (I don't see a smoking gun in the logs, but if I pepper some extra logging in it looks like its having trouble with the call to mkdir
). I installed MSYS2 as recommended by the "Windows 7 and later compilation and development guide" in the libretro docs, then tried using MinGW-W64 and MinGW-W32 shells but the builds from both crash RetroArch.
The odd thing is that I have an old build from the branch I mentioned above on this same machine, and that one works still, but I can't remember what I might have done differently back then, so I was hoping you might be able to help. Thanks!
I installed MSYS2 as recommended by the "Windows 7 and later compilation and development guide" in the libretro docs
Yeah I followed the same guide, then idk I didn't do anything special, just cd to platform/libretro/ then make and that's it. Then in RetroArch: Main Menu > Load Content, select a .p8 file and it works just fine for me.
It seems to crash when loading the core without content however (so Main Menu > Load Core > FAKE-08 > Start Core), looks like it's because of info
being NULL in retro_load_game()
, it crashes here: https://github.com/jtothebell/fake-08/blob/46cdbcf44582ebebdfe6be417cabd5041e9bfc34/platform/libretro/libretro.cpp#L621
But in any case I don't seem to have any issue with mkdir anymore 🤔
@bslenul Well, I'm still not sure what is wrong with that windows machine, but I tried it on someone else's and it worked fine, so I set up a CI build in github actions and that output also seems to be working. I also threw in a quick fix to that crash. It just loads the cart list cart, which isn't really useful as configured, but at least it doesn't crash.
Hello!
So yesterday I wanted to mess a bit with the Libretro core but couldn't build it (for Windows, using MinGW), first there was some includes missing due to GCC13 (now partially fixed thanks to #208, I still had to add one more in libretrohosthelpers.h) but then I'm getting this:
I'm building on Windows with MinGW, so I simply changed:
to:
and it built just fine, I wanted to submit a PR but I'm not sure about the define, is this correct? Should it be
__MINGW32__
instead? Idk, I'm way too noob at this :/And same thing happens when I try to build standalone:
And again, it builds fine if I use the #fidef _WIN32.