qmc2 / qmc2-mame-fe

QMC2 - M.A.M.E. Catalog / Launcher II
40 stars 3 forks source link

Cannot compile MacOS due to SDL errors (both x64 and Silicon) #29

Closed estefan3112 closed 1 year ago

estefan3112 commented 1 year ago

Hi Rene, suddenly I cannot compile on Intel plus Silicon Macs. Despite the SDL framework being installed (both Framework and Homebrew), the compile fails with strange SDL errors (excerpt below).

So I cannot compile on any platform currently. Must be due to SDL upgrades.

Cheers, Stefan

(...) In file included from src/about.cpp:9: /Library/Frameworks/SDL2.framework/Headers/SDL.h:32:10: fatal error: 'SDL2/SDL_main.h' file not found

include <SDL2/SDL_main.h>

(...) In file included from src/joystick.h:11: /Library/Frameworks/SDL2.framework/Headers/SDL.h:32:10: fatal error: 'SDL2/SDL_main.h' file not found

include <SDL2/SDL_main.h>

(...) In file included from src/welcome.cpp:17: In file included from src/options.h:17: In file included from src/joystick.h:11: /Library/Frameworks/SDL2.framework/Headers/SDL.h:32:10: fatal error: 'SDL2/SDL_main.h' file not found

include <SDL2/SDL_main.h>

     ^~~~~~~~~~~~~~~~~

In file included from src/options.cpp:24: In file included from src/options.h:17: In file included from src/joystick.h:11: /Library/Frameworks/SDL2.framework/Headers/SDL.h:32:10: fatal error: 'SDL2/SDL_main.h' file not found

include <SDL2/SDL_main.h>

It goes on like that...

qmc2 commented 1 year ago

/Library/Frameworks/SDL2.framework/Headers/SDL.h:32:10: fatal error: 'SDL2/SDL_main.h' file not found

Have you even installed SDL2?

estefan3112 commented 1 year ago

Yes of course, latest versions of SDL2, both the Framework from the SDL site and the Homebrew packages. Used to work before, wll check again.

qmc2 commented 1 year ago

To be more precise: You seem to have installed something in the the wrong way. It finds the frameworks header but this one somehow want SDL_main.h, which can't be found. Something is wrong with your SDL2 installation, not a QMC2 issue.

estefan3112 commented 1 year ago

Strangely all other compiles work (including SDL2), need to investigate further

estefan3112 commented 1 year ago

Dear Rene, there are currently two issues in the MacOS compiles that I could verify:

  1. SDL: By coincidence I figured out that the code compiles nicely with an older SDL Framework release 2.0.20 of January 2022. I did not check all versions since then, but with the last SDL Framework release 2.26.1, the compile fails with the above errors. This applies to both Intel and Silicon Macs.
  2. A recurring problem in QMake: The Apple Silicon Build misses -spec macx-clang-arm64 and fails with an error on macx-clang. After manually adding the right spec to the qmake line, it configures and compiles correctly.

As always happy to help, I could also test the SDL Frameworks backwards if that would make any difference...apparently some change in the SDL framework causes this error.

Best, Stefan

estefan3112 commented 1 year ago

Add on: Ok, it stopped working with SDL 2.24.0, actually the first one with the new numbering scheme...

estefan3112 commented 1 year ago

Dear Rene, may I suggests to re-open this issue: A comparison of the Makefile.qmakes shows sigificant differences, so something is going on there.

I opened a thread in the SDL Developer Forum, where your contribution would probably be very helpful: https://discourse.libsdl.org/t/macos-fatal-error-sdl2-sdl-main-h-file-not-found-since-sdl-2-24-0/42029

Cheers! Stefan :-)

qmc2 commented 1 year ago

I'm really unsure what to answer or contribute. It seems to be a Qt 5 qmake issue then? Dunno. I read all of the thread at discourse.libsdl.org but anything than irritation is not left :).

estefan3112 commented 1 year ago

Thanks Rene for the info. It just does not work since quite some SDL versions on Macs, that's quite unsatisfying.