magsac
magsac copied to clipboard
Make failed due to C++17 standard thing ....
Hi, @danini and @ducha-aiki ,
Thanks for sharing your great work!
Unfortunatelly, issues raised when I compile it on linux machine with gcc 5.2.0. I am stuck and any advice would be appreciated!
Thanks!
Appended is the error:
$ make -j4
[ 10%] Building CXX object CMakeFiles/GraphCutRANSAC.dir/graph-cut-ransac/src/pygcransac/include/GCoptimization.cpp.o [ 20%] Building CXX object CMakeFiles/GraphCutRANSAC.dir/graph-cut-ransac/src/pygcransac/include/graph.cpp.o [ 30%] Building CXX object CMakeFiles/GraphCutRANSAC.dir/graph-cut-ransac/src/pygcransac/include/LinkedBlockList.cpp.o [ 40%] Building CXX object CMakeFiles/MAGSAC.dir/include/gamma_values.cpp.o [ 50%] Building CXX object CMakeFiles/MAGSAC.dir/include/magsac.cpp.o [ 60%] Building CXX object CMakeFiles/MAGSAC.dir/include/model_score.cpp.o [ 70%] Building CXX object CMakeFiles/GraphCutRANSAC.dir/graph-cut-ransac/src/pygcransac/include/maxflow.cpp.o [ 80%] Building CXX object CMakeFiles/MAGSAC.dir/src/main.cpp.o [ 90%] Linking CXX static library libGraphCutRANSAC.a [ 90%] Built target GraphCutRANSAC In file included from /home/Code/magsac/include/magsac.cpp:1:0: /home/Code/magsac/include/magsac.h: In member function ‘bool MAGSAC<DatumType, ModelEstimator>::sigmaConsensusPlusPlus(const cv::Mat&, const gcransac::Model&, gcransac::Model&, ModelScore&, const ModelEstimator&, const ModelScore&)’: /home/Code/magsac/include/magsac.h:743:20: error: expected unqualified-id before ‘[’ token for (const auto &[residual, idx] : residuals) ^ /home/Code/magsac/include/magsac.h:743:20: error: expected ‘;’ before ‘[’ token /home/Code/magsac/include/magsac.h:743:21: error: ‘residual’ was not declared in this scope for (const auto &[residual, idx] : residuals) ^ /home/Code/magsac/include/magsac.h:743:31: error: ‘idx’ was not declared in this scope for (const auto &[residual, idx] : residuals) ^ /home/Code/magsac/include/magsac.h: In lambda function: /home/Code/magsac/include/magsac.h:743:36: error: expected ‘{’ before ‘:’ token for (const auto &[residual, idx] : residuals) ^ /home/Code/magsac/include/magsac.h: In member function ‘bool MAGSAC<DatumType, ModelEstimator>::sigmaConsensusPlusPlus(const cv::Mat&, const gcransac::Model&, gcransac::Model&, ModelScore&, const ModelEstimator&, const ModelScore&)’: /home/Code/magsac/include/magsac.h:743:36: error: expected ‘;’ before ‘:’ token /home/Code/magsac/include/magsac.h:743:36: error: expected primary-expression before ‘:’ token /home/Code/magsac/include/magsac.h:743:36: error: expected ‘)’ before ‘:’ token /home/Code/magsac/include/magsac.h:743:36: error: expected primary-expression before ‘:’ token make[2]: *** [CMakeFiles/MAGSAC.dir/include/magsac.cpp.o] Error 1 make[2]: *** Waiting for unfinished jobs.... In file included from /home/Code/magsac/graph-cut-ransac/src/pygcransac/include/fundamental_estimator.h:52:0, from /home/Code/magsac/graph-cut-ransac/src/pygcransac/include/types.h:39, from /home/Code/magsac/graph-cut-ransac/src/pygcransac/include/utils.h:48, from /home/Code/magsac/src/main.cpp:16: /home/Code/magsac/graph-cut-ransac/src/pygcransac/include/GCRANSAC.h: In member function ‘void gcransac::GCRANSAC<_ModelEstimator, _NeighborhoodGraph, _ScoringFunction, _PreemptiveModelVerification>::run(const cv::Mat&, const _ModelEstimator&, gcransac::sampler::Sampler<cv::Mat, long unsigned int>, gcransac::sampler::Sampler<cv::Mat, long unsigned int>, const _NeighborhoodGraph*, gcransac::Model&, _PreemptiveModelVerification&)’: /home/Code/magsac/graph-cut-ransac/src/pygcransac/include/GCRANSAC.h:305:8: error: expected ‘(’ before ‘constexpr’ if constexpr (!std::is_same<preemption::EmptyPreemptiveVerfication<_ModelEstimator>, _PreemptiveModelVerification>()) ^ /home/Code/magsac/src/main.cpp:1181:1: error: expected ‘}’ at end of input } ^ /home/Code/magsac/src/main.cpp:1181:1: error: expected ‘}’ at end of input /home/Code/magsac/src/main.cpp:1181:1: error: expected ‘}’ at end of input /home/Code/magsac/src/main.cpp: At global scope: /home/Code/magsac/src/main.cpp:1181:1: error: expected ‘}’ at end of input make[2]: *** [CMakeFiles/MAGSAC.dir/src/main.cpp.o] Error 1 make[1]: *** [CMakeFiles/MAGSAC.dir/all] Error 2 make: *** [all] Error 2
P.S.: The very code can be successfully built on Mac book and it runs.
@stoneyang You need to use gcc-7, not gcc-5. And it would be nice if you could specify the gcc version in the README. @danini