Ask Your Question

nodelet: error: nullptr was not declared in this scope

asked 2018-05-24 08:52:03 -0500

bear234 gravatar image

I'm trying to install the ros base from source following this link, everyting works fine.

Then I download the package nodelet and all of its dependencies packages. However, when I compile all of packages with catkin_make, I get an error:

[ 75%] Building CXX object CMakeFiles/nodeletlib.dir/src/loader.cpp.o
In file included from /root/system-full/tmp/install_isolated/include/class_loader/class_loader.hpp:46:0,
                 from /root/system-full/tmp/install_isolated/include/class_loader/multi_library_class_loader.hpp:42,
                 from /root/system-full/tmp/install_isolated/include/pluginlib/class_loader.hpp:38,
                 from /root/system-full/tmp/src/nodelet_core/nodelet/src/loader.cpp:34:
/root/system-full/tmp/install_isolated/include/class_loader/class_loader_core.hpp: In function ‘void class_loader::impl::registerPlugin(const string&, const string&)’:
/root/system-full/tmp/install_isolated/include/class_loader/class_loader_core.hpp:183:7: error: ‘nullptr’ was not declared in this scope
   if (nullptr == getCurrentlyActiveClassLoader()) {

I can compile the package class_loader without any error but when I try to compile the package nodelet, I will get the error above.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2018-05-24 10:30:20 -0500

gvdhoorn gravatar image

Kinetic is "only" compatible with platforms with compilers supporting C++11 (see REP-3). nullptr was added in C++11.

The fact that you see that error implies that whatever platform your compiling on / for does not have C++11 support (or doesn't have it enabled).

You'll have to either enable C++11 support in your compiler, or if that is not possible change to a compiler that does support it.

edit flag offensive delete link more


gcc -v shows me the version of gcc is 5.4. I think it does support c++11

bear234 gravatar image bear234  ( 2018-05-24 20:13:46 -0500 )edit

at lease, g++ -std=c++11 can compile c++11 code on my machine.

bear234 gravatar image bear234  ( 2018-05-24 20:18:52 -0500 )edit

I don't know why your particular platform doesn't have C++11 enabled by default. The kinetic-devel dev-job on the buildfarm doesn't show the same error and uses GCC5.4 as well: log.

gvdhoorn gravatar image gvdhoorn  ( 2018-05-25 02:30:11 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2018-05-24 08:52:03 -0500

Seen: 1,912 times

Last updated: May 24 '18