Comments (4)
Original comment by Martín Lucas Golini (Bitbucket: SpartanJ, GitHub: SpartanJ).
Hi!
If i remember correctly the SDL2 header file in the SDL2 Framework is not located in the SDL2 sub-folder. That seems to be the problem. But i need to make some changes in the premake4.lua file to detect if you're using xcode and the framework. I'll look into that as soon as i can.
from soil2.
Original comment by Johannes P. (Bitbucket: [Johannes P.](https://bitbucket.org/Johannes P.), ).
Hi Martín, thanks for the fast reply!
As far as I can tell, the framework is laid out correctly, according to Apple's framework guidelines: https://developer.apple.com/library/prerelease/mac/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/FrameworkAnatomy.html - See Listing 3 under 'Additional Directories', and note that it matches the layout found in SDL2.framework:
I am Not using Xcode. This is entirely with gmake. I may be mistaken, but as far as I understand, when using a non-system framework in a program being compiled under g++ or clang you need two flags when compiling and linking:
- -framework (What framework)
- -F <PATH TO FRAMEWORK(S)> (Where to find it)
If that is done correctly than headers in the framework such as SDL.h are found automatically, or at least that seems to be what line 22 and 32 of my snippet above suggest. This is further supported when you consider the fact that without the -F flag the linking step does not work (line 28), and you don't even need the header file when linking. It simply has to do with providing the compiler with the location of the framework, and it does the rest.
To quote the man page - http://linux.die.net/man/1/g++ :
#!
-Fdir
Add the framework directory dir to the head of the list of directories to be searched for header files.
These directories are interleaved with those specified by -I options and are scanned in a left-to-right order.
So effectively, during the compilation step, you can use -I and manually provide the path to the framework's header directory, ie:
#!shell
-I /Library/Frameworks/SDL2.framework/Headers
And for that single framework would accomplish the same thing as:
#!shell
-F /Library/Frameworks
But that kind of defeats the point of using frameworks in the first place, not to mention you need to do -I /path/to/framework/header for every single framework, instead of just one -F /path/where/all/frameworks/are
TL;DR: the SDL2 framework is laid out correctly, but when compiling with g++ or clang you need to use -F /Path/To/Framework to ensure the compiler can traverse the standardized framework file structure and locate the header file.
from soil2.
Original comment by Johannes P. (Bitbucket: [Johannes P.](https://bitbucket.org/Johannes P.), ).
A minor update:
When creating a separate premake5 project I'm able to fix this issue by manually adding the -F
flag to my build and link options:
https://gist.github.com/JohannesMP/9a9b5263c127103f1861#file-premake5-lua-L24-L26 (see highlighted lines) - doing so appends the correct -F ...
flag to the make variables ALL_CFLAGS
and ALL_LDFLAGS
However when I attempt to add that with premake4 it seems that the resulting make file fails to include the flags in All_CFLAGS
as well as ALL_LDFLAGS
(as can be seen when using make verbose=1
). I'm not quite sure why.
I'll play around with it a bit more. I can manually get the make files to compile if I append -F /Library/Frameworks
to each instance of ALL_CFLAGS
and ALL_LDFLAGS
in the resulting .make files
On a semi-related note, here is an issue regarding frameworks in premake that I opened on the premake repo: premake/premake-core#196
from soil2.
Original comment by Martín Lucas Golini (Bitbucket: SpartanJ, GitHub: SpartanJ).
This should improve the tests on OS X.
Thanks for your help,
Regards
from soil2.
Related Issues (20)
- HDR textures HOT 1
- 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
- install issue macOS HOT 15
- 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
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.