AlisterT / openjazz

OpenJazz
GNU General Public License v2.0
275 stars 49 forks source link

Updated build instructions (Windows 10 64 bit here) #81

Closed Gagert closed 12 months ago

Gagert commented 3 years ago

I have msys2 installed on my Windows 10, I downloaded the latest build of OpenJazz, extracted the content into the home folder inside my msys2 folder and tried using mingw64,exe inside te msys2 folder to compile OpenJazz.

I opened the OpenJazz folder within the command window, simply typed make and watched msys2 do all the compiling stuff. After that was done, I got the openjazz.exe file, added that file as well as openjazz.000 to my JazzCD folder, and then tried to start the newest build.

An Application Error message appeared when starting, even though if I install the released build from 2019 of OpenJazz (OpenJazz-20190106-win64.zip), and put the openjazz exe & 000 file of that folder inside my JazzCD folder, it all worked just fine using that old build.

In other words, I must be doing something wrong when compiling the newest build. The instructions provided on the GitHub front page of this project is very sparse, and so is the info found on http://www.alister.eu/jazz/oj/build.php as well in my opinion.

I'm not much into programming, but I've been able to compile various applications before. I'm very dependent on proper instructions of how to compile for each project however, and I'm kind of stuck successfully compiling this on Windows 10 64 bit. There was no error messages when compiling in msys2, so I find it odd that I can't get the compiled exe file of OpenJazz to work.

carstene1ns commented 3 years ago

Can you please give me more information? Build log and the error message would be nice. I have actually no idea of msys2 on Windows, since I cross-compile from Linux. However, it should be enough to install SDL and do the usual make run.

Can you test if the latest continuous build works for you? https://nightly.link/AlisterT/openjazz/workflows/ci/master

Gagert commented 3 years ago

Here's the information I can provide as of now:

When building openjazz in msys2 (mingw64.exe):

Building by typing make seems to be working fine and all that, the problem occurs when copying the newly compiled OpenJazz.exe as well as copying the provided openjazz.000 file from the msys2/home/user/openjazz folder to the JazzCD folder and then trying to run OpenJazz.exe. The openjazz folder inside my msys2 folder I've been compiling is the ff36254 build found on this GitHub page.

Anyway, when opening the newly compiled build of OpenJazz by opening OpenJazz.exe that I now have copied into the JazzCD folder, I'm being approached with the following error message:

This doesn't happen if i move over the pre-compiled build you generously provided me with with the link you gave me, that OpenJazz compiled build works fine. I'll be using that pre-compiled build moving forward for further testing.

If I open the .bash_history file found in msys2/home/user folder in Notepad++, this seems like the closest thing I currently have to a build log. As I don't know how to provide files here on GitHub, I only know how to provide direct links to my imgur account's images, here's an image of the most recent happening of that log-file:

carstene1ns commented 3 years ago

Thank you, that is really helpful.

The problem is here the dynamic linking, that means the needed libraries need to be copied from msys2 to the application folder (e.g. [...]/mingw64/bin/SDL.dll).

You could try a static build:

make clean
LDFLAGS="-static" make
Gagert commented 3 years ago

I tried building again with those settings, I managed to actually get an build error while compiling now:

Seems like I'm missing something Gamepad related in my msys2 folder or something like that? I just read "GUID_XAxis" and a lot of related warning signs before the build failed.

fabiangreffrath commented 3 years ago

The error message you posted earlier occurs if you mix up 32 and 64 bit executables and shared libraries. You cannot link everything statically in Windows, because not all low-level system libraries have static variants available.

Gagert commented 3 years ago

If so I might have to configure a Linux variant on a thumb drive and try cross compiling a Windows 64 bit executable from there. Maybe even setting up a virtual Linux machine inside of Windows 10 could also do the trick, I'll just need a way to provide myself with compiled new builds of OpenJazz.

carstene1ns commented 12 months ago

For the SDL2 CI builds I now use the dynamic library, which needs to be copied and should work as before.