Comments (15)
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.
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.
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.
Mmh: it actually already does that:
Line 11 in 8cf904d
How you built the project?
from soil2.
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.
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.
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.
I should delete the premake4 version, it's not updated, that's why it's failing.
from soil2.
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.
premake4 gmake project should work fine with your configuration with the latests changes.
from soil2.
it works!!
Thanks!!!
from soil2.
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.
You probably just need to change the include:
#include <SDL2/SDL.h>
to
#include <SDL.h>
How did you install SDL2?
from soil2.
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.
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)
- Unable to compile HOT 1
- weird linking errors HOT 1
- SOIL_load_OGL_cubemap returning null type HOT 5
- How do I use SOIL2 HOT 16
- Set GL_TEXTURE_MAX_LEVEL for DDS files with incomplete mip chain
- Add arg (Int*width and int*height) to function with XXX__OGL_XXX.
- Support uwp in vcpkg
- Unable to link static lib (Android)
- compiling SOIL2 with mingw64 gcc version 11.2.0 HOT 2
- Compiler Error VS2022 HOT 5
- lib version HOT 1
- Missing documentation HOT 1
- Cannot find source file in CMake HOT 1
- invalid strcmp
- Compiler warnings (clang) HOT 1
- SOIL2 is amazing but how without OpenGL ? HOT 2
- compiling SOIL2 with mingw64 gcc version 13.1.0 in windows 11 HOT 2
- Not usable with nanovg HOT 5
- Update stb image
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from soil2.