Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

gmonkey

gcc and Mesa3D

This topic is 5859 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

i can''t get a simple opengl prog to compile under linux. this is with Mesa3D installed, GLUT in place, samples compiled just fine and run so i know it''s set up more or less properly. if i compile with gcc cube.c -o cube -lglut -lGLU -lGL it compiles with no errors but when i try to run the executable is says ./cube: error while loading shared libraries: libglut.so.3: cannot open shared object file: No such file or directory guess i''m not linking it right. i''ve done openGL programming before but never under redhat. what''s the proper way to compile the code?

Share this post


Link to post
Share on other sites
Advertisement
Before you say -lglut you need to indicate where your GL libraries are at with the -L switch. For example, -Luser/x11r6/lib is how I think you do it on Mandrake.

Share this post


Link to post
Share on other sites
Well, if you''re getting to the point to where you can launch your application, then it''s beyond a linking problem. It sounds like you haven''t configured ld properly. LD_LIBRARY_PATH can be set to ''.'' to search the directory ./cube is in (assuming by "in place"). You should probably install glut properly in the future, either by a package (debian: apt-get install libglut3), or /usr/local/lib (you may need to update /etc/ld.so.conf and run ldconfig as root).

Share this post


Link to post
Share on other sites
if i specify -L then it gives me an error:

/usr/local/lib/libGL.so: undefined reference to `grBufferSwap''
collect2: ld returned 1 exit status

thing is all the demos run with no problems. i guess i''ll try to recompile some of them and see what options are used...

Share this post


Link to post
Share on other sites
solved my own problem. didn''t bother with the LD_LIBRARY_PATH variable. just specified -Xlinker -R/path/etc in the gcc command line. no more errors. well, not from linking anyway...

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!