2.3. Installing on Linux

Before attempting to install the SGL on a Linux system, be sure that the gcc development tools and GLUT library are in place. Test a simple non-SGL program that uses GLUT to make sure it compiles and runs successfully.

  1. As root, copy the sgl.h and sgl.hpp header files into the /usr/include/GL directory:

     cp sgl.h sgl.hpp /usr/include/GL
    

  2. Set the permissions of the header files appropriately:

     chmod go+r /usr/include/GL/sgl.h /usr/include/GL/sgl.hpp
    

You can build an SGL program named my_prog.cpp with the following command:

  g++ -Wall -o my_prog my_prog.cpp -lglut -lGLU


Copyright  ©2019 Richard L. HaltermanVersion 0.9.5February 17, 2019
Creative Commons License This work is licensed under a Creative Commons License.