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

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

Closed
manta-ranching opened this issue Jun 21, 2023 · 6 comments
Closed

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

manta-ranching opened this issue Jun 21, 2023 · 6 comments
Labels

Comments

@manta-ranching
Copy link

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 manta-ranching changed the title MacOS buiold error: 'SDL2/SDL_main.h' file not found MacOS build error: 'SDL2/SDL_main.h' file not found Jun 21, 2023
@manta-ranching
Copy link
Author

@manta-ranching
Copy link
Author

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

@manta-ranching
Copy link
Author

......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
Copy link

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

@ec-
Copy link
Owner

ec- commented Oct 20, 2023

Please check current sources

@ec- ec- added the bug label Oct 20, 2023
@kevinmcq
Copy link

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.

@ec- ec- closed this as completed Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants