Skip to content
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

Game doesn't compile with mingw-w64 targetting Windows on Linux #459

Closed
rawr51919 opened this issue Mar 8, 2021 · 11 comments
Closed

Game doesn't compile with mingw-w64 targetting Windows on Linux #459

rawr51919 opened this issue Mar 8, 2021 · 11 comments

Comments

@rawr51919
Copy link
Contributor

Describe the bug
mingw-w64 fails to compile sm64ex when make is ran using the tools mingw-w64 provides for Ubuntu Linux to cross-compile the game for Windows.

To Reproduce
Steps to reproduce the behavior:

  1. Use make WINDOWS_BUILD=1 CROSS=x86_64-w64-mingw32- CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ SDLCONFIG=sdl2-config TEXTURE_FIX=1 NODRAWINGDISTANCE=1 DISCORDRPC=1 to attempt a compile using mingw-w64
  2. Game compiles until the final exe link
  3. We hit the linker errors described below.

Expected behavior
Game compiles successfully

Screenshots
image
image

Desktop (please complete the following information):

  • OS: [e.g. iOS] Windows 10 Pro Education + WSL2 (Ubuntu 20.04.2 LTS)

Additional context
Trying to add more options for us folks to compile the PC port easily so I looked further into mingw-w64 cross-compilation and this is as far as I've been able to go with it. I previously have been able to achieve this type of cross-compilation using MXE, both prepackaged and from source, so it's not like it's my first rodeo with this or anything.

@rawr51919
Copy link
Contributor Author

This was also discovered during the testing process of PR #456, which is why you see elements from that here in the screenshots.

@rawr51919
Copy link
Contributor Author

When make clean was ran, a different error ensued
image

@fgsfdsfgs
Copy link
Collaborator

Are you sure it's using the correct sdl2-config?

@rawr51919
Copy link
Contributor Author

mingw-w64 doesn't have an sdl2-config, so it has to use an sdl2-config from somewhere else

@rawr51919
Copy link
Contributor Author

It has one on MSYS2 but not here with the mingw-w64 libraries for Ubuntu

@fgsfdsfgs
Copy link
Collaborator

Well that would point to your local /lib and /include directories and not the the mingw ones, which is why it can't find SDL.h.

@rawr51919
Copy link
Contributor Author

rawr51919 commented Mar 8, 2021

I wonder if this requires it's own set of ifdefs to fix
Or perhaps mingw-w64 needs to be pointed to the local lib/include directories via symlinks to the files?

@fgsfdsfgs
Copy link
Collaborator

fgsfdsfgs commented Mar 9, 2021

It does not require any code changes to fix. At worst Makefile changes, but I believe this can probably be fixed on your side completely.
Are you sure your SDL2 lib in mingw doesn't come with its own sdl2-config? It normally does in mingw-w64.

@rawr51919
Copy link
Contributor Author

This is using WSL and Ubuntu, whose mingw-w64 doesn't have sdl2-config as a package.

@rawr51919
Copy link
Contributor Author

The closest I have for an sdl2-config would be the mingw-w64 sdl2-config the AUR has

@fgsfdsfgs
Copy link
Collaborator

fgsfdsfgs commented Mar 9, 2021

sdl2-config is not a separate package. It's a script that invokes pkg-config and it is part of your SDL2 package:

$ pacman -Ql mingw-w64-i686-SDL2
mingw-w64-i686-SDL2 /mingw32/
mingw-w64-i686-SDL2 /mingw32/bin/
mingw-w64-i686-SDL2 /mingw32/bin/sdl2-config
mingw-w64-i686-SDL2 /mingw32/bin/SDL2.dll
mingw-w64-i686-SDL2 /mingw32/include/
mingw-w64-i686-SDL2 /mingw32/include/SDL2/
mingw-w64-i686-SDL2 /mingw32/include/SDL2/begin_code.h
mingw-w64-i686-SDL2 /mingw32/include/SDL2/close_code.h
mingw-w64-i686-SDL2 /mingw32/include/SDL2/SDL.h
...

Actually my bad, it doesn't invoke pkg-config, but still.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants