ec- / Quake3e

Improved Quake III Arena engine
GNU General Public License v2.0
1.21k stars 154 forks source link

MacOS build error: 'SDL2/SDL_main.h' file not found #226

Closed manta-ranching closed 1 year ago

manta-ranching commented 1 year ago

Since I got SDL framework installed to the right directory, make does find SDL.h However, now it's failing to find SDL_main.h. In fact this is in the same directory as SDL.h. But build is expecting to find it somewhere else?

Compiling on M2.

Full output:

% make USE_VULKAN=0                                              
grep: repetition-operator operand invalid

Building quake3 in build/release-darwin-aarch64:

  VERSION: 
  PLATFORM: darwin
  ARCH: aarch64
  COMPILE_PLATFORM: darwin
  COMPILE_ARCH: aarch64
  CC: cc

  CFLAGS:
    -DUSE_RENDERER_DLOPEN
    -DRENDERER_PREFIX="quake3e"
    -DRENDERER_DEFAULT=opengl
    -DUSE_CURL
    -DUSE_CURL_DLOPEN
    -DUSE_VULKAN_API
    -DUSE_OPENGL_API
    -MMD
    -Wall
    -Wimplicit
    -Wstrict-prototypes
    -pipe
    -Wno-unused-result
    -I/Library/Frameworks/SDL2.framework/Headers
    -DNDEBUG
    -O2
    -fvisibility=hidden

  Output:
    build/release-darwin-aarch64/quake3e.ded
    build/release-darwin-aarch64/quake3e
    build/release-darwin-aarch64/quake3e_opengl_aarch64.dylib

make[2]: `build/release-darwin-aarch64/quake3e.ded' is up to date.
CC code/sdl/sdl_glimp.c
In file included from code/sdl/sdl_glimp.c:29:
/Library/Frameworks/SDL2.framework/Headers/SDL.h:32:10: fatal error: 'SDL2/SDL_main.h' file not found
#include <SDL2/SDL_main.h>
         ^~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [build/release-darwin-aarch64/client/sdl_glimp.o] Error 1
make[1]: *** [targets] Error 2
make: *** [release] Error 2
manta-ranching commented 1 year ago

Maybe related: https://discourse.libsdl.org/t/macos-fatal-error-sdl2-sdl-main-h-file-not-found-since-sdl-2-24-0/42029/4

manta-ranching commented 1 year ago

Using older SDL binaries fixed this issue: https://github.com/libsdl-org/SDL/releases?q=2.0.22

manta-ranching commented 1 year ago

......however, after compiling with SDL 2.0.22 I experienced an issue where my mouse movement would be restricted ingame.

Compiled again with this SDL version: https://github.com/libsdl-org/SDL/releases/download/release-2.0.18/SDL2-2.0.18.dmg

Now q3e is running smoothly!

andreagiavatto commented 1 year ago

Related issue for those that want to use the latest version.

ec- commented 1 year ago

Please check current sources

kevinmcq commented 1 year ago

I believe this is now resolved. I no longer have to use 2.0.18 for my intel macbook, latest build working without any issues.