-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to compile on Windows with MSYS2 #37
Comments
Looks like MINGW can't find #ifdef _WIN32
#include <fcntl.h>
#include <io.h>
#include <stdio.h> // <----- add this one
#include <windows.h> Then recompile the project. Did it work? |
The error is now gone, but the linker stage fails:
|
Seems like SDL 2 is failing now. Not sure what could be causing it to fail with the linker. There's also an error like "undefined reference to `__imp__dupenv_s'", which could be fixed by adding the --libs argument. |
Adding
What program is that |
Whoops, seems --libs is for pkg-config. |
pkg-config needs a package name to be specified, and I'm not sure what package is causing the problem. |
Loguru is the other library I noticed that has issues linking. Not sure how MinGW is trying to compile this. |
Output of make with
|
https://issueantenna.com/repo/emilk/loguru/issues/128 Found one related issue. |
After putting const char* home_dir()
{
#ifdef _WIN32
char* user_profile;
size_t len;
#ifdef _MSC_VER // here
errno_t err = _dupenv_s(&user_profile, &len, "USERPROFILE");
CHECK_F(err != 0, "Missing USERPROFILE");
#endif // and here
return user_profile;
#else // _WIN32
auto home = getenv("HOME");
CHECK_F(home != nullptr, "Missing HOME");
return home;
#endif // _WIN32
} The build has no more errors, but the resulting binary can only be run from within the MinGW terminal and I get missing DLL errors if I run it from outside (e.g. CMD) |
You'll want to download the SDL2 DLL (or just copy the DLL from the SDL2 folder over to the same place as the DingusPPC executable). After that, there should be no more issues. |
Not only do I have to copy SDL2.dll, but also libgcc_s_seh-1.dll, libstdc++-6.dll, libwinpthread-1.dll, only then will the emulator work. Also 2 bugs: one being that the emulator window is always not responding despite actually still running, the other being when you quit from the debugger after entering it with Ctrl-C, the emulator will crash:
|
I've known about the former for a while, but the latter is new. My guess is that it's still trying to execute code, but Ctrl-C isn't quite working right somehow. |
@dingusdev |
Despite making modifications to devices/serial/chario.cpp, the persistently frustrating error continues to appear for me. |
To reproduce in 64-bit MSYS2:
Output log of CMake:
Output log of
make dingusppc
:The text was updated successfully, but these errors were encountered: