toddhester / rl-texplore-ros-pkg

Automatically exported from code.google.com/p/rl-texplore-ros-pkg
61 stars 24 forks source link

Error when running make #7

Open dtdannen opened 2 years ago

dtdannen commented 2 years ago

Ran 'catkin_make' under top-level dir, then cd into src/ and tried running 'make' and got this error:

$ make

[  0%] Built target _rl_msgs_generate_messages_check_deps_RLStateReward
[  0%] Built target std_msgs_generate_messages_lisp
[  0%] Built target _rl_msgs_generate_messages_check_deps_RLAction
[  0%] Built target _rl_msgs_generate_messages_check_deps_RLEnvDescription
[  0%] Built target _rl_msgs_generate_messages_check_deps_RLEnvSeedExperience
[  0%] Built target _rl_msgs_generate_messages_check_deps_RLExperimentInfo
[  5%] Built target rl_msgs_generate_messages_lisp
[  5%] Built target std_msgs_generate_messages_py
[ 12%] Built target rl_msgs_generate_messages_py
[ 12%] Built target std_msgs_generate_messages_nodejs
[ 17%] Built target rl_msgs_generate_messages_nodejs
[ 17%] Built target std_msgs_generate_messages_eus
[ 24%] Built target rl_msgs_generate_messages_eus
[ 24%] Built target std_msgs_generate_messages_cpp
[ 29%] Built target rl_msgs_generate_messages_cpp
[ 29%] Built target rl_msgs_generate_messages
Scanning dependencies of target agentlib
[ 30%] Building CXX object rl_agent/CMakeFiles/agentlib.dir/src/Agent/DiscretizationAgent.cc.o
In file included from /home/dustin/code_projects/rl-texplore-ros-pkg/src/rl_agent/include/rl_agent/DiscretizationAgent.hh:4,
                 from /home/dustin/code_projects/rl-texplore-ros-pkg/src/rl_agent/src/Agent/DiscretizationAgent.cc:1:
/home/dustin/code_projects/rl-texplore-ros-pkg/src/rl_common/include/rl_common/Random.h:1129:23: error: ‘constexpr’ needed for in-class initialization of static data member ‘const float Random::_F’ of non-integral type [-fpermissive]
 1129 |    static const float _F    = 1. / _M;
      |                       ^~
make[2]: *** [rl_agent/CMakeFiles/agentlib.dir/build.make:63: rl_agent/CMakeFiles/agentlib.dir/src/Agent/DiscretizationAgent.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1443: rl_agent/CMakeFiles/agentlib.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

Solution:

change line 1129 of rl-texplore-ros-pkg/src/rl_common/Random.h to remove 'static' to be:

const float _F = 1. / _M;

After this change, running make worked just fine.

vitormartins01 commented 8 months ago

Hello @dtdannen, See my step 2 in the pull request comments, i made today. Cheers.