Sign in to follow this  

Compiling in G++

This topic is 4855 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

HI im trying to compile an opengl app in g++ now i don't know how to add the libs in command line so i can compile or how to make a makefil for it. Its lesson3 from NEHE. Could anyone please advice me what to do? it includes gl.h, glu.h and glaux.h

Share this post


Link to post
Share on other sites
-I is used to locate the header files and -L is used to locate the libraries and -l (little L) is used to specify specific libraries.

So for example if you had OpenGls include files in /local/opengl/include and its libraries in /local/opengl/lib you might do something like:

g++ -I /local/opengl/include myprogram.cc -L /local/opengl/lib -lGL -lGLU -lGLaux

unfortunately depending on the system you're on and what opengl you're using the locations and names of the libraries may be different.

edit: fixed case on lib names (to the best of my memory)

Share this post


Link to post
Share on other sites

This topic is 4855 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this