ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Building an executable with OpenGL

asked 2011-09-23 04:51:18 -0500

hanneshdc gravatar image

I have a C++ program which requires glut and OpenGL to run. If I was compiling without ROS, I would add the compiler flags -lGL and -lGLU. However when using rosmake and CMakeLists I obviously can't.

How can I make rosmake link to external system libraries?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2011-09-23 05:06:40 -0500

Hordur gravatar image

updated 2011-09-23 11:41:47 -0500

tfoote gravatar image

If you're writing a library which will be used from another package in your manifest.xml you should export required flags, e.g. <export> <cpp lflags="-lGL -lglut" /> </export>

For the a binary in your CMakeLists.txt you could add target_link_libraries(yourprogram GL glut)


link_libraries(GL glut)

edit flag offensive delete link more

Question Tools


Asked: 2011-09-23 04:51:18 -0500

Seen: 2,410 times

Last updated: Sep 23 '11