Libaries and other things.
How do you link libs using gcc? Lets say I need to use the OpenGL libaries how would I link them? Also, is there a IDE that I can use above gcc?
"The most likely way for the world to be destroyed, most experts agree, is by accident. That''s where we come in; we''re computer professionals. We cause accidents."
-Nathaniel Borenstein
-----------------------------When men speak of the future, the Gods laugh.An apology for the devil: it must be remembered that we have heard one side of the case. God has written all the books.Samuel Butler (1835 - 1902)
For linking, just take a look at man gcc. Sorry to be so blunt, but it''s right in there.
For IDE''s, check out Anjuta or KDevelop. If either of those are the wrong URLs, just find them thru Google
rm -rf /bin/laden
For IDE''s, check out Anjuta or KDevelop. If either of those are the wrong URLs, just find them thru Google
rm -rf /bin/laden
Mmmm...I doubt you could find the answer in the man pages actually. Depends how you''re using the open gl libraries. In general its not obvious what to put out in order to link a specific library.
To use open gl when lining you probably want to use one (or all, depending) of the following:
-lglut -lGLU -lGL
Ignore -lGLU and -lglut if you dont use them (glut or the glu calls). -lGL is enough to get open gl working with say, GlX, SDL. Some of the libraries (or toolkits) like glut, gtk, or whatever may require -lglu, depending on how you use them and how they''re written.
(In general, if you want to know what -lXXXX to put in, look in the /usr/lib or equivalent directory. There will usually be files called libXXXX.so.N. It''s usually pretty obvious. -However- not always. For instance, using the MIT shared memory extension requires -lXext. It can be tricky, sometimes determining what to use. Often documentation of the libraries doesn''t cover this. =(
To use open gl when lining you probably want to use one (or all, depending) of the following:
-lglut -lGLU -lGL
Ignore -lGLU and -lglut if you dont use them (glut or the glu calls). -lGL is enough to get open gl working with say, GlX, SDL. Some of the libraries (or toolkits) like glut, gtk, or whatever may require -lglu, depending on how you use them and how they''re written.
(In general, if you want to know what -lXXXX to put in, look in the /usr/lib or equivalent directory. There will usually be files called libXXXX.so.N. It''s usually pretty obvious. -However- not always. For instance, using the MIT shared memory extension requires -lXext. It can be tricky, sometimes determining what to use. Often documentation of the libraries doesn''t cover this. =(
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement