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

preprocessor errors of catkin_make

asked 2015-07-10 11:46:21 -0500

Zhao Cheng gravatar image

updated 2015-07-10 13:24:42 -0500

joq gravatar image

Dear ALL

Recently I want to transplant an old version code to Ubuntu 14.04 with ROS Indigo. But when I catkin_make the old code, there are many preprocessor errors like:

In file included from /usr/include/math.h:32:0,
                 from /usr/include/c++/4.8/cmath:44,
                 from /usr/include/c++/4.8/complex:44,
                 from /usr/include/eigen3/Eigen/Core:28,
                 from /usr/include/eigen3/Eigen/Dense:1,
                 from /home/cheng/catkin_ws/src/pioneer_neo/neo_3dlabelling/src/include/generic_utils.h:4,
                 from /home/cheng/catkin_ws/src/pioneer_neo/neo_3dlabelling/./src/include/features.h:20,
                 from /usr/include/x86_64-linux-gnu/c++/4.8/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/4.8/bits/c++config.h:426,
                 from /usr/include/c++/4.8/cstddef:41,
                 from /usr/include/boost/config/select_stdlib_config.hpp:18,
                 from /usr/include/boost/config.hpp:40,
                 from /usr/include/boost/cstdint.hpp:36,
                 from /usr/include/pcl-1.7/pcl/pcl_macros.h:41,
                 from /usr/include/pcl-1.7/pcl/point_types.h:42,
                 from /home/cheng/catkin_ws/src/pioneer_neo/neo_3dlabelling/src/include/point_types.h:19,
                 from /home/cheng/catkin_ws/src/pioneer_neo/neo_3dlabelling/src/include/global_define.h:19,
                 from /home/cheng/catkin_ws/src/pioneer_neo/neo_3dlabelling/src/graeae.cpp:16:

/usr/include/x86_64-linux-gnu/bits/huge_val.h:26:18: error: missing binary operator before token "("
 #if __GNUC_PREREQ(3,3)
                  ^
/usr/include/x86_64-linux-gnu/bits/huge_val.h:28:20: error: missing binary operator before token "("
 #elif __GNUC_PREREQ(2,96)

I am just a new beginner and I google many websites. But I still did not find the solution. Could anyone give me some suggestions? Thank you so much!

Henry

edit retag flag offensive close merge delete

Comments

What previous ROS version did it work with?

joq gravatar image joq  ( 2015-07-10 14:24:52 -0500 )edit

In Ubuntu12.04 with groovy, it can works well. It is compiled using rosmake. But in Ubuntu 14.04 with indigo, it is compiled using catkin_make. The preprocessor errors occurred.

Zhao Cheng gravatar image Zhao Cheng  ( 2015-07-10 14:45:19 -0500 )edit

Did you convert your package from rosmake to catkin_make?

joq gravatar image joq  ( 2015-07-10 16:04:44 -0500 )edit

Have you tried building it with rosmake, as before?

joq gravatar image joq  ( 2015-07-10 16:05:14 -0500 )edit

yep, I converted it from rosmake to catkin_make through modifying CMakeLists.txt. It can be built through rosmake in groove in Ubuntu12.04

Zhao Cheng gravatar image Zhao Cheng  ( 2015-07-10 16:20:56 -0500 )edit

This looks to be just a C++ error where __GNUC_PREREQ is not yet defined: http://stackoverflow.com/questions/30... You might just try including #include <cstring> first thing in the files which fail to compile.

William gravatar image William  ( 2015-07-10 16:39:18 -0500 )edit

Many thanks for everybody's help. I built it using rosmake instead of catkin_make in Indigo in Ubuntu 14.04. The preprocessor errors did not occur again. Why using catkin_make, the preprocessor errors occurred. It really confuses me.

Zhao Cheng gravatar image Zhao Cheng  ( 2015-07-10 16:59:47 -0500 )edit

That is a mystery. I'm not aware of any difference in the two that could manifest like this.

William gravatar image William  ( 2015-07-10 17:40:32 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2015-07-11 05:53:58 -0500

Zhao Cheng gravatar image

Many thanks for everybody's help. Maybe I made some mistakes of the path of include file. I put my include files in the src subdirectories. When I # the ./src/include/ and ./src/include/impl/ in CmakeLists.txt:

include_directories( ./src/include/ ./src/include/impl/ ${catkin_INCLUDE_DIRS})

the preprocessor errors disappeared.

edit flag offensive delete link more
0

answered 2015-07-10 13:27:21 -0500

joq gravatar image

updated 2015-07-10 17:12:19 -0500

For working with a new version of ROS, always build from a clean workspace.

Either check out new copies of your code, or delete the build/ and devel/ subdirectories from your old one.

EDIT for future reference: ROS Indigo still supports rosmake for building from source, but not for releasing binary packages.

edit flag offensive delete link more

Comments

Many thanks for your answer. I made a new catkin_ws and then catkin_make it. But the preprocessor errors still occurred.

Zhao Cheng gravatar image Zhao Cheng  ( 2015-07-10 14:02:32 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2015-07-10 11:46:21 -0500

Seen: 702 times

Last updated: Jul 11 '15