Compiler Behavior Differs When Executed by Catkin vs. Command Line

asked 2017-01-07 11:42:43 -0600

liangfok gravatar image

I'm running into a situation where compiling a C++ program using Catkin results in a different behavior compared to executing the same compiler command directly in the command line. The compiler command executed by Catkin is obtained using:

catkin build --verbose -j1

Specifically, the header files that are found differ between the two scenarios. When compiled using Catkin, the compiler (incorrectly) finds and includes a header file in /opt/ros/indigo/include/. When I copy/paste Catkin's compiler command into the command line, the compiler (correctly) finds and links a header file in my_catkin_workspace/install/include/. Does anybody know why or how this could happen?

Fundamentally, I'd like to prioritize finding header files in my_catkin_workspace/install/include/ over header files in /opt/ros/indigo/include/. Does anyone know how to do that?

edit retag flag offensive close merge delete