Giter Club home page Giter Club logo

Comments (15)

SpartanJ avatar SpartanJ commented on July 27, 2024

You should install it as a framework or change the include to
#include <SDL/SDL.h>
since homebrew install it in a subfolder.

from soil2.

thewoz avatar thewoz commented on July 27, 2024

what do you mean whit "install as a framework"?

I try also to install SDL from https://www.libsdl.org via GitHub mirror https://github.com/SDL-mirror/SDL but the headers is in /usr/local/include SDL2

so the solution is to change all the #include in SOILD2 to #include <SDL/SDL.h>?
I will do it but for the future is not more easy to change it directly in your repository since the installation of SDL see to be always in a subfolder?

from soil2.

SpartanJ avatar SpartanJ commented on July 27, 2024

The official SDL2 library distribution is provided as a macOS framework, and the paths are different than the homebrew version. The framework can be downloaded from the official site: https://libsdl.org/release/SDL2-2.0.14.dmg. After installing the framework, to generate the project run:
premake5 --use-frameworks [projecttype, ex: gmake]
Otherwise, you can change the includes, yes. But, since I can't detect the SDL2 library path from your installation, and by default tries to use the "official" SDL2 path, it won't work with the homebrew paths. Anyway, this is only to run the demo, SOIL2 does not depend on SDL2. I could improve this by checking if the build runs from a framework or a custom installation, I'll do that for sure in the near future.

from soil2.

SpartanJ avatar SpartanJ commented on July 27, 2024

Mmh: it actually already does that:

#if ( ( defined( _MSCVER ) || defined( _MSC_VER ) ) || defined( __APPLE_CC__ ) || defined ( __APPLE__ ) ) && !defined( SOIL2_NO_FRAMEWORKS )

How you built the project?

from soil2.

thewoz avatar thewoz commented on July 27, 2024

hi
now I have the SDL lib installed from https://github.com/SDL-mirror/SDL
and I have the SDL file in /usr/local/include/SDL2

for SOIL I have done:

premake4 gmake premake4.lua
cd make/macosx
make config=release

and I get

==== Building soil2-static-lib (release) ====
==== Building soil2-shared-lib (release) ====
==== Building soil2-test (release) ====
test_SOIL2.cpp
../../src/test/test_SOIL2.cpp:12:11: fatal error: 'SDL.h' file not found
#include <SDL.h>
^~~~~~~
1 error generated.
make[1]: *** [../../obj/macosx/release/soil2-test/test_SOIL2.o] Error 1
make: *** [soil2-test] Error 2

from soil2.

thewoz avatar thewoz commented on July 27, 2024

but since SDL is only need to run the demo
it is not possible to split the process in two parts? the installation of SOIL2 and the demo?
So that you don't have compile the demo and thus I can avoid to install SDL?

from soil2.

SpartanJ avatar SpartanJ commented on July 27, 2024

Use:
make config=release soil2-static-lib or make config=release soil2-shared-lib
To build the test you'll have to change:
#include <SDL.h>
to
#include <SDL2/SDL.h>

from soil2.

SpartanJ avatar SpartanJ commented on July 27, 2024

I should delete the premake4 version, it's not updated, that's why it's failing.

from soil2.

thewoz avatar thewoz commented on July 27, 2024

ok thanks..
my be it would be nice have a make install that copy the lib in /usr/local/lib and copy all the .h in a SOIL2 folder in /usr/local/include

from soil2.

SpartanJ avatar SpartanJ commented on July 27, 2024

premake4 gmake project should work fine with your configuration with the latests changes.

from soil2.

thewoz avatar thewoz commented on July 27, 2024

it works!!
Thanks!!!

from soil2.

milton-keynes avatar milton-keynes commented on July 27, 2024

Hello, Mr.SpartanJ.
I have SDL2 and SOIL2 in /usr/local/include.
Then I have done:
premake5 gmake premake5.lua
cd make/macosx
make
I got:
clang: warning: argument unused during compilation: '-msse2' [-Wunused-command-line-argument]
test_SOIL2.cpp
clang: warning: argument unused during compilation: '-msse2' [-Wunused-command-line-argument]
../../src/test/test_SOIL2.cpp:15:11: fatal error: 'SDL2/SDL.h' file not found
#include <SDL2/SDL.h>
^~~~~~~~~~~~
1 error generated.

Thx, looking forward to your reply...

from soil2.

SpartanJ avatar SpartanJ commented on July 27, 2024

You probably just need to change the include:
#include <SDL2/SDL.h>
to
#include <SDL.h>

How did you install SDL2?

from soil2.

milton-keynes avatar milton-keynes commented on July 27, 2024

I installed it as a framework, and I put SDL2.framework on /usr/local/include
OK I have changed the #include <SDL2/SDL.h> to #include <SDL.h>, but this is my new error
> make

==== Building soil2-static-lib (debug_x86_64) ====
==== Building soil2-shared-lib (debug_x86_64) ====
==== Building soil2-test (debug_x86_64) ====
test_SOIL2.cpp
clang: warning: argument unused during compilation: '-msse2' [-Wunused-command-line-argument]
../../src/test/test_SOIL2.cpp:16:14: fatal error: 'SDL.h' file not found
#include <SDL.h>
^~~~~~~
1 error generated.
make[1]: *** [../../obj/macosx/x86_64/debug/soil2-test/test_SOIL2.o] Error 1
make: *** [soil2-test] Error 2

This is how I changed on SOIL2/src/test/test_SOIL2.cpp

#define NO_SDL_GLEXT
#if ( ( defined( _MSCVER ) || defined( _MSC_VER ) ) || defined( __APPLE_CC__ ) || defined ( __APPLE__ ) ) && !defined( SOIL2_NO_FRAMEWORKS )
	#include <SDL.h>
	#include <SDL_opengl.h>
#else
//	#include <SDL2/SDL.h>
    #include <SDL.h>
	#include <SDL2/SDL_opengl.h>
#endif

from soil2.

SpartanJ avatar SpartanJ commented on July 27, 2024

I installed it as a framework, and I put SDL2.framework on /usr/local/include
That is not how it works. Download the libsdl dmg and follow the instructions in the ReadMe file. Then follow my instructions.

from soil2.

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.