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

Crashes on catalina #22

Open
benjaminselfridge opened this issue Sep 7, 2020 · 6 comments
Open

Crashes on catalina #22

benjaminselfridge opened this issue Sep 7, 2020 · 6 comments

Comments

@benjaminselfridge
Copy link

Starts up okay, but when I try to start a new game it simply crashes. I'm on OS X Catalina. Single display, OpenGL driver.

@kamleshgk
Copy link

How did you compile it?
I get error when i run Make
src/client/input/sdl.c:30:10: fatal error: 'SDL2/SDL.h' file not found

@jdolan
Copy link
Owner

jdolan commented Nov 10, 2020

You'll need to install SDL2 via MacPorts or Homebrew.

@kamleshgk
Copy link

kamleshgk commented Nov 11, 2020

Hi @jdolan
Do we need SDL2 or 1.2

I installed SDL2 via Brew - then added the path to INCLUDE in the MakeFile

ifeq ($(PLATFORM),darwin)
	CFLAGS += -D__APPLE__ -I/opt/local/include -I/usr/local/include/SDL2
endif

Then run the MakeFile and i get these and many other similar errors

src/linux/rw_sdl.c:166:7: error: use of undeclared identifier 'SDLK_KP9';
src/linux/rw_sdl.c:283:25: error: use of undeclared identifier 'SDL_FULLSCREEN'
src/linux/rw_sdl.c:297:4: error: use of undeclared identifier 'SDL_GrabMode'

what could i be missing?
p.s
Notice that Linux files are getting compiled even tho i go to 'Apple' folder and run Make. I even run Make in root folder, same.

@jdolan
Copy link
Owner

jdolan commented Nov 11, 2020

Yes, sorry, SDL 1.2. And yes, it will compile the Linux source files. Those files have some conditional directives for Apple. The Makefile is fairly straightforward. You’ll need sdl-config and curl-config on your PATH.

@kamleshgk
Copy link

Cool thanks @jdolan

I added the 1.2 version's "SDL.framework" file to /Library/Frameworks and added the path
-I/Library/Frameworks/SDL.framework/Versions/A/Headers to CFLAGS and it compiled fine.

But am getting linker errors

Undefined symbols for architecture x86_64:
  "_SDL_CloseAudio", referenced from:
      _SNDDMA_Shutdown in snd_sdl.o
  "_SDL_CreateRGBSurface", referenced from:
      _SetSDLIcon in rw_sdl.o
  "_SDL_EnableKeyRepeat", referenced from:
      _SDLimp_InitGraphics in rw_sdl.o
  "_SDL_FreeSurface", referenced from:

Do i need to add the SDL lib in LDFLAGS variable?
The SDL lib is found here
/Library/Frameworks/SDL.framework/Versions/A/SDL

Thanks in advance.

@jdolan
Copy link
Owner

jdolan commented Nov 12, 2020

Yes, of course you need to also link against it. sdl-config --cflags and sdl-config --libs might help you here, too.

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

3 participants