Open chasonr opened 6 years ago
I meant to say that MSYS2 seems to be overtaking MinGW-w64. Qt 5 is still OK on Windows.
Take these instructions with a grain of salt; I'm booted into Fedora and would need to reboot to Windows to check them out:
You'll need to install Qt; as noted above, the current Qt comes with a copy of MinGW-w32. Your favorite Windows version of git will also make this easier. Download the nethack-3.6.0-patches archive, and set the branch to interfaces. Run setup.bat from sys/winnt.
Go to src and edit Makefile.gcc. You'll probably want these settings: TARGET_CPU=x86 WANT_WIN_QT4=1 WANT_WIN_SDL2=0 WANT_WIN_CURSES=0 QT4_DIRECTORY=c:/Qt/Qt5.9.2/5.9.2/mingw53_32 # or whichever version you've installed HAVE_QT5=Y WANT_PNG=N
Run mingw32-make -f Makefile.gcc and let me know how it goes.
Thanks for the answer, I will try!
Ok, I did everything, but I could not compile. Here's the log:
When I installed qt 5.9.2, I was offered to install two different versions of mingw, I installed both. There are two paths: C: \ Qt \ Qt5.9.2 \ 5.9.2 \ mingw53_32 \ C: \ Qt \ Qt5.9.2 \ Tools \ mingw530_32 \ File mingw32-make.exe is not present in the folder C: \ Qt \ Qt5.9.2 \ 5.9.2 \ mingw53_32 \ bin \, is in C: \ Qt \ Qt5.9.2 \ Tools \ mingw530_32 \ bin . In the makefile.gcc file, I specified QT4_DIRECTORY = C: \ Qt \ Qt5.9.2 \ Tools \ mingw530_32. What could be the problem?
First, let me revise my instructions. The lines containing WANT_WIN_SDL2, WANT_WIN_CURSES and WANT_PNG need to be commented out, not changed. Mea culpa. I should revise Makefile.gcc to make that clearer. You'll want to do "mingw32-make -f Makefile.gcc spotless" before you try again.
Second, the QT4_DIRECTORY is for finding that include file named in the error at the end, and others like it. It needs to be C:/Qt/Qt5.9.2/5.9.2/mingw53_32 , and you probably should use the forward slashes, usual practice on Windows notwithstanding.
Your PATH environment variable finds mingw32-make; it also finds gcc, and it did find gcc, so that seems to be set correctly.
I commented WANT_WIN_SDL2, WANT_WIN_CURSES and WANT_PNG lines. Registered in makefile.gcc: QT4_DIRECTORY = C: /Qt/Qt5.9.2/5.9.2/mingw53_32 . Result:
Ok, its done with qt 4.8.6. I launch nethackw.exe, and I see the standard interface of nethack on windows, lol. When I wanted compile nethack on windows, first of all I wanted to see its interface, which I saw on Linux. Is it possible to change the interface?
Very interesting error dump...I'll have to investigate.
If you have a successful compile, you should have the file defaults.nh in the same directory as nethackw.exe. Edit this and add a line "OPTIONS=windowtype:Qt" wherever you find it convenient. Make sure no other "OPTIONS=windowtype:x" line is present.
Now earned. Thank you so much! Somewhat buggy, but playable.
I've updated Makefile.gcc. It now works with the current Qt 5; it needed -std=c++11. Would you like to try again? You'll need to run setup.bat and repeat your edits. If not, I'll go ahead and close this issue.
Ok, i will try. What is -std=c++11?
An option passed to the compiler, meaning use the 2011 version of C++. It's in Makefile.gcc; you don't need to set this yourself.
It's working, gj! There is a couple of non-critical bugs, the first one: after starting the game and selecting a character, the error pops up: IO Error Cannot load "\nethack/rip.xpm", if you press ok, the game continues without any problems, only when you die, the picture of the tombstone is not displayed. The rip.xpm file exists in the folder. The second bug: if you close the nethack through a cross in the upper right corner, writes "This will end your NetHack session", it is suggested to choose "save" or "cancel". If you select "cancel", the game closes, but remains in the processes in the task manager.
Thanks! I'll leave this issue open for now, since you have reported bugs.
The rip.xpm issue looks like it might be related to #7
Reposting comment from tux871 on the Devteam's repository:
"Did not understand which project gave way to msys2? Did not understand your phrase "against either Qt 4 or 5, using MinGW-w64", does this mean that I can compile only the qt 4 branch in windows? I have to use a branch: interfaces, right? What is the easiest way to compile? Without a difference, qt 4 or 5. I have little idea what to do in order to compile, what should I read to learn how to do this?"