Using GCC/Sublime to compile SDL programs on Linux

How can I use either GCC or the Sublime IDE to compile my SDL based project on Linux?

gcc program.cpp -o program -lSDL

I have tried this and I just get errors that seem to be pointing to the idea that either the program isn’t pointing at the library the right way or the compiler isn’t recognizing the library. On Sublime I have essentially done the same thing by creating my own build system for SDL, but it doesn’t really seem to do anything at all. What might I be doing wrong?

     "cmd" : [ "gcc", "$file", "-o", "-lSDL" ] 

I hope this question is appropriate on this stack, it can be considered Linux tooling but the Linux and Unix stack doesn’t suggest programming questions unless they consist of shell scripting.

Let me know if you need more information or error outputs.

Source: gcc

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.