Thread: GLUT on Linux

  1. #1

    GLUT on Linux

    What libraries do I need to link up with to use GLUT on linux? I'm linking with glut, gl, and glu and it still says I'm missing a few functions. They all start with X and have something to do with extensions.

  2. #2
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    try this:

    -lglut -lGL -lGLU -lX11 -lXmu -lm

    dont forget to specify the lib paths:


    and the include paths:


  3. #3
    It still gives me the same errors.
    Here's some of them:
    /usr/lib/ undefined reference to 'XGetExtensionVersion'
    /usr/lib/ undefined reference to 'XFreeDeviceList'
    /usr/lib/ undefined reference to 'XListInputDevices'
    /usr/lib/ undefined reference to 'XFreeDeviceState'
    /usr/lib/ undefined reference to 'XOpenDevice'
    /usr/lib/ undefined reference to 'XSelectExtensionState'
    Here's what I used to compile:
    g++ -g -o gluttest main.o -L/usr/lib -L/usr/local/lib -lglut -lGL -L/usr/X11R6/lib -lXext -ldl -lGLU -lX11 -lXmu -lm

  4. #4
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Ontario, Canada
    Add -lXi and see what happens.
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  5. #5
    Thanks, man. It fixed all the errors.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Wireless Network Linux & C Testbed
    By james457 in forum Networking/Device Communication
    Replies: 3
    Last Post: 06-11-2009, 11:03 AM
  2. Dabbling with Linux.
    By Hunter2 in forum Tech Board
    Replies: 21
    Last Post: 04-21-2005, 04:17 PM
  3. installing linux for the first time
    By Micko in forum Tech Board
    Replies: 9
    Last Post: 12-06-2004, 05:15 AM
  4. Compiling OpenGL (GLUT) on Linux
    By Unregistered in forum Linux Programming
    Replies: 1
    Last Post: 04-02-2002, 01:38 PM