Slamtec / rplidar_ros

BSD 2-Clause "Simplified" License
504 stars 532 forks source link

Fix build with C++14 && --march=native #14

Closed NeoPhix closed 1 year ago

NeoPhix commented 5 years ago

Fix build with C++14 && --march=native flags on Intel Core i7

I have the build problem if I try to build rplidar_ros with the following flags on my system:

catkin build --cmake-args -DCMAKE_CXX_STANDARD=14 -DCMAKE_CXX_FLAGS=-march=native -DCMAKE_C_FLAGS=-march=native -DCMAKE_BUILD_TYPE=Release

The compiler shows some errors like this:

изображение

I spent some time on this and I found a solution:

rplidar_ros has two unused defines le and be macros. They overwrite names of local varibales in standard includes that leads us to compliation fail. I didn't find any place where that macro (le and be) are used. I decide to delete them.

Please approve this PR if I am right.

Thank you.