#1.5 Intro to Modern OpenGL Tutorial: Linux Setup

Video is ready, Click Here to View ×

In this video, we create a project and link to the libraries on linux.



  1. If you prefer Code::Blocks for Windows, all you need to do is to make certain you add "SDL2main" to your linker (Project->Build Options then Linker Settings tab) so you have "SDL2main" before "SDL2" linked. You'll also need "opengl32" rather than "GL" and "glew32" rather than "GLEW" and "mingw32". For this, I have the following:


    Another problem with his examples on Windows is that you NEED to define main() like this:

    int main(int argc, char *argv[])


    int main()

    Or you will get more undefined errors to do with WinMain.

    Edit: After entering and compiling his program on Shaders, I encountered more problems with GLEW, I tracked them down to do with using the VC version of glew with Code::Blocks. The solution was that I found a pre-compiled version specifically for MinGW and it worked fine. So you will have to either track down a version of glew specifically for MinGW (I used an older 1.10 version), or compile it yourself… or… use Visual C… personally, I would rather slit my wrists than use VC. 😉

  2. When I add SDL2 to the project in code blocks (on centos) it tells me error while loading shared libraries: libSDL2-2.0.so.0: cannot open shared object file: No such file or directory. Any idea why?

  3. I believe coding is like language speaking, only you have to learn the "culture" of computers so you have to code in a sense of declaring stuff and things, i am new to coding, currently doing event driven which i think is a good start to familiarise myself with the concept, but what are differences from say C#, C, and C++? And Java..

    i should probably watch a few C++ tutorials before continuing watching this, but it seems interesting for me even if i don't exactly understand.

  4. For people with OpenSUSE – just go to your package manager (Software Management).  All libraries are there.


    apt-get doesn't work on OpenSUSE, and Zypper wont find your files as the naming convention is slightly different.

    I'm using 13.2 – you're welcome 🙂

  5. Hey, the sudo apt-get install libsdl2-dev command gives me the following output:

    Reading package lists… Done
    Building dependency tree       
    Reading state information… Done
    E: Unable to locate package libsdl2-dev
    What am I doing wrong?

Leave a Reply

Your email address will not be published.