osx - Compiling with SDL1.2 on mac -


i have code i'm trying compile using sdl.

my code simple , have followed steps in sdl's ready add sdl mac under /library/frameworks.

yet when i'm trying compile cannot find header reason.

here code ( bit around include of sdl header):

#include <sdl.h> 

and way compile code:

g++ [mycppfiles] -o a.out -framework glut -framework opengl -framework sdl -std=c++98 -l /library/frameworks/sdl.framework/headers/ 

would know why cannot find sdl header?

finally got working. apparently shouldn't add -framework sdl , tell compiler in correct directory sdl.h

here command line use compiling:

g++ [myfiles.cpp] -o a.out -framework glut -framework opengl -std=c++98 -i/library/frameworks/sdl.framework/headers/ `sdl-config --cflags --libs`  

if don't add bit sdl-config --cflags --libs cannot find definition of functions used in sdl.


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -