Struggling to Use Self Built SDL 2

So I need to link from my SDL build to /usr/local/lib … what should I link? Just sdl-config, or more than that?

And yes, mostly a learning experience. I’d like to just make a simple cross platform game with one codebase.

Why is it so challenging to utilize SDL without an IDE? Is it possible to just add SDL files to my project directory and use the header files from there?

FYI- thanks all for the continuous help : )

Soz it took so long to reply, Just a few things.

  1. Regardless how you build the project, your .h and .cpp files can be compiled on windows or linux as long as you don’t platform specific things such as system(…) on windows for example.

  2. If you installed with brew and want to add the files to your project directly you can cd in to /usr/local/Cellar/sdl2/2.0.9
    and copy the header folder and the .lib files and put them where ever you want.

I assume the reason ppl do not do this is they don’t want multiple copies of the header folders and libs in every application they create.

  1. Why not just use `sdl2-config --cflags` `sdl2-config --libs`
    All this does is substitute the paths for you.
1 Like