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

Revision history [back]

click to hide/show revision 1
initial version

I assume you mean that you wrote a compiler for C++, since C++ is not an interpreted language.

ROS uses whatever compiler the environment says is the current one. How to change the compiler for your environment (which can be done on a shell-by-shell basis, or system wide) is not really ROS specific, but it's also easy enough to do. Set the CC environment variable to the compiler's executable to change the C compiler, and the CXX environment variable to change the C++ compiler. If you are using CMake (which you are for ROS) then you can also do it in a CMakeLists.txt file by setting the CMAKE_C_COMPILER and CMAKE_CXX_COMPILER variables to the path to the compiler executable. I'm not sure how much Catkin will like having this variable changed in one package, though. It might take effect for the whole workspace, or it might just be overridden.