Jump to content
  • Advertisement
Sign in to follow this  

Compiling in G++

This topic is 5015 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
Advertisement
-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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!