Tuesday, February 11, 2014

Errors


the errors that I get while compiling GTSAM 2.3.1 on the ubuntu 12.04

/home/sai/workspace/gtsam-2.3.1/examples/SolverComparer.cpp: In function ‘void runPerturb()’:
/home/sai/workspace/gtsam-2.3.1/examples/SolverComparer.cpp:487:3: error: ‘mt19937’ is not a member of ‘boost::random’
/home/sai/workspace/gtsam-2.3.1/examples/SolverComparer.cpp:487:3: note: suggested alternative:
/usr/include/boost/random/mersenne_twister.hpp:361:47: note:   ‘boost::mt19937’
/home/sai/workspace/gtsam-2.3.1/examples/SolverComparer.cpp:487:26: error: expected ‘;’ before ‘rng’
/home/sai/workspace/gtsam-2.3.1/examples/SolverComparer.cpp:488:3: error: ‘normal_distribution’ is not a member of ‘boost::random’
/home/sai/workspace/gtsam-2.3.1/examples/SolverComparer.cpp:488:3: note: suggested alternative:
/usr/include/boost/random/normal_distribution.hpp:37:7: note:   ‘boost::normal_distribution’
/home/sai/workspace/gtsam-2.3.1/examples/SolverComparer.cpp:488:38: error: expected primary-expression before ‘double’
/home/sai/workspace/gtsam-2.3.1/examples/SolverComparer.cpp:488:38: error: expected ‘;’ before ‘double’
/home/sai/workspace/gtsam-2.3.1/examples/SolverComparer.cpp:497:26: error: ‘rng’ was not declared in this scope
/home/sai/workspace/gtsam-2.3.1/examples/SolverComparer.cpp:497:29: error: ‘normal’ was not declared in this scope
make[2]: *** [examples/CMakeFiles/SolverComparer.dir/SolverComparer.cpp.o] Error 1
make[1]: *** [examples/CMakeFiles/SolverComparer.dir/all] Error 2
make: *** [all] Error 2


Solution


The error is solved by changing the lines 487 and 488 from examples/SolverComparer.cpp

  boost::random::mt19937 rng;
  boost::random::normal_distribution normal(0.0, perturbationNoise);

to

  boost::mt19937 rng;
  boost::normal_distribution normal(0.0, perturbationNoise);

Thanks.

No comments:

Post a Comment