Solaris Opengl Header problems


Im using solaris with bash.

I have entered CC -o Demo and I get the following error:

Error: Could not open include file<GL/gl.h>.  

I get several more for glx, glext and glut

This means that the linker can not find the GL files as they are not in the system path. How do you do this in Solaris & Bash?

Thanks For your help

Actually it means the compiler not the linker cant find the files. Find the location of the files on your system. A brute force method is

find / -name gl.h  

and then add the path of that to the compiler using the -I flag e.g. if the gl.h is in


then you would use

CC -I/usr/local/include -o Demo  

Though I suspect you are going to have many more problems e.g. unresolved symbols because you aren’t linking in the openGL and GLUT libraries.

These kind of posts should really go in the Linux forum not here. Though I would suggest just reading the man pages on the compiler and linker to get an understanding of what they do and the command line flags first.



I tried what you said, it still is wanting those files…


A bit more information might be helpful. For instance;

  1. So you found the directory containing the files. Where are they?
  2. What EXACTLY did you type on the command line to compile the demo?
  3. Show the EXACT output you get from that command line.

People can’t help without information to work with.