Giter Club home page Giter Club logo

Comments (9)

vygr avatar vygr commented on June 12, 2024 1

I have just pushed the changes for Homebrew only. I hope this works for everyone. It works here after I deleted my Frameworks folder for sdl, so fingers crossed.

I've added links to the docs to point at Homebrew installer etc.

from chrysalisp.

vygr avatar vygr commented on June 12, 2024

Did you use the Makefile_Homebrew Makefile ?

Two Makefile provided. And we are just having a convo on the Element chat about switching to just a Homebrew based Makefile. So go back to just 1 and that's only Homebrew.

from chrysalisp.

vygr avatar vygr commented on June 12, 2024

If you have sdl installed via Homebrew and prefer that way.

make -f Makefile_Homebrew install

This is yet more weight to the Homebrew only install argument.

from chrysalisp.

vygr avatar vygr commented on June 12, 2024

I will add a comment to the intro install doc mentioning the two makesfiles.

from chrysalisp.

ghaerr avatar ghaerr commented on June 12, 2024

#include <SDL.h>

The standard way of installing SDL2 requires that the above line be changed in the C source file to #include <SDL2/SDL.h>. This works and allows for multiple installations of SDL to be installed (SDL 3 is now current, but that's another topic). I am already having to do this whenever I pull upstream, or I can't get things to compile, even with my homebrew installation.

I would be in favor of having the 'default' method be one that uses -lSDL2 on the command line and the above #include, as that's what is required for either installing via Homebrew or building and installing SDL from source on macOS or another system.

IIRC, only the very earliest of SDL2 installs required manually installing the framework, which was a big pain. I've only had to do it once on the many macOS systems I have running.

@vygr, you might try running brew install sdl2 (I think that's the correct name) on your system, it can coexist with the framework you've already installed and then we could possibly change to only having and maintaining a single Makefile.

from chrysalisp.

ghaerr avatar ghaerr commented on June 12, 2024

I think the idea of having two Makefiles is an issue for newbies (like myself): frankly, I never even looked for secondary Makefiles, etc. Just typed make to see what happened. I was able to correct it because I'm using SDL2 for a number of other projects on macOS.

I have just been applying this patch when updating:

diff --git a/Makefile b/Makefile
index f0181f33a..cae570719 100644
--- a/Makefile
+++ b/Makefile
@@ -47,7 +47,7 @@ obj/$(CPU)/$(ABI)/$(OS)/main_gui:	$(OBJ_FILES_GUI)
 ifeq ($(OS),Darwin)
 	c++ -o $@ $^ \
 		-F/Library/Frameworks \
-		-framework SDL2
+		-lSDL2
 endif
 ifeq ($(OS),Linux)
 	c++ -o $@ $^ \
diff --git a/src/main.cpp b/src/main.cpp
index 5ca7f3f85..ad67010dc 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -35,7 +35,8 @@
 	#include <libkern/OSCacheControl.h>
 #endif
 #ifdef _GUI
-	#include <SDL.h>
+	#include <SDL2/SDL.h>
 #endif
 
 #define VP64_STACK_SIZE 8192

from chrysalisp.

vygr avatar vygr commented on June 12, 2024

I have Homebrew installed on my Mac and the SDL2 package.

That why I'm leaning towards a Homebrew only make as it does make things easier.

I had Macports at one point but Homebrew proved better (hope that doesn't start a flame war)

from chrysalisp.

ghaerr avatar ghaerr commented on June 12, 2024

Another idea would be to just swap the Makefiles - make the Homebrew version the default Makefile, and see whether anyone complains. If so, have them use the other renamed Makefile_macOSFrameworks. I haven't tested to see whether this method fixes the problematic #include <SDL2/SDL.h> or not though.

from chrysalisp.

paul-hammant avatar paul-hammant commented on June 12, 2024

Yay - confirmed as working for me

from chrysalisp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.