danini / graph-cut-ransac

The Graph-Cut RANSAC algorithm proposed in paper: Daniel Barath and Jiri Matas; Graph-Cut RANSAC, Conference on Computer Vision and Pattern Recognition, 2018. It is available at http://openaccess.thecvf.com/content_cvpr_2018/papers/Barath_Graph-Cut_RANSAC_CVPR_2018_paper.pdf

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make Error

XuyangBai opened this issue · comments

Thanks for the great work and sharing. I met the following problem during make CC=gcc-9 CPP=g++-9 CXX=g++-9 LD=g++-9

In file included from /home/altizure/xuyang/graph-cut-ransac/src/pygcransac/include/fundamental_estimator.h:52:0,
                 from /home/altizure/xuyang/graph-cut-ransac/src/pygcransac/include/types.h:39,
                 from /home/altizure/xuyang/graph-cut-ransac/src/pygcransac/include/utils.h:48,
                 from /home/altizure/xuyang/graph-cut-ransac/examples/cpp_example.cpp:3:
/home/altizure/xuyang/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/altizure/xuyang/graph-cut-ransac/src/pygcransac/include/GCRANSAC.h:305:8: error: expected ‘(’ before ‘constexpr’
     if constexpr (!std::is_same<preemption::EmptyPreemptiveVerfication<_ModelEstimator>, _PreemptiveModelVerification>())
        ^
/home/altizure/xuyang/graph-cut-ransac/examples/cpp_example.cpp:1481:1: error: expected ‘}’ at end of input
 }
 ^
/home/altizure/xuyang/graph-cut-ransac/examples/cpp_example.cpp:1481:1: error: expected ‘}’ at end of input
/home/altizure/xuyang/graph-cut-ransac/examples/cpp_example.cpp:1481:1: error: expected ‘}’ at end of input
/home/altizure/xuyang/graph-cut-ransac/examples/cpp_example.cpp: At global scope:
/home/altizure/xuyang/graph-cut-ransac/examples/cpp_example.cpp:1481:1: error: expected ‘}’ at end of input
In file included from /home/altizure/xuyang/graph-cut-ransac/src/pygcransac/include/grid_neighborhood_graph.h:36:0,
                 from /home/altizure/xuyang/graph-cut-ransac/src/pygcransac/include/fundamental_estimator.h:48,
                 from /home/altizure/xuyang/graph-cut-ransac/src/pygcransac/include/types.h:39,
                 from /home/altizure/xuyang/graph-cut-ransac/src/pygcransac/include/utils.h:48,
                 from /home/altizure/xuyang/graph-cut-ransac/examples/cpp_example.cpp:3:
/home/altizure/xuyang/graph-cut-ransac/src/pygcransac/include/neighborhood_graph.h: In instantiation of ‘gcransac::neighborhood::NeighborhoodGraph<_DataContainer>::NeighborhoodGraph() [with _DataContainer = cv::Mat]’:
/home/altizure/xuyang/graph-cut-ransac/src/pygcransac/include/grid_neighborhood_graph.h:165:48:   required from here
/home/altizure/xuyang/graph-cut-ransac/src/pygcransac/include/neighborhood_graph.h:56:9: warning: ‘gcransac::neighborhood::NeighborhoodGraph<cv::Mat>::initialized’ will be initialized after [-Wreorder]
    bool initialized;
         ^
/home/altizure/xuyang/graph-cut-ransac/src/pygcransac/include/neighborhood_graph.h:50:34: warning:   ‘const cv::Mat* const gcransac::neighborhood::NeighborhoodGraph<cv::Mat>::container’ [-Wreorder]
    const _DataContainer  * const container;
                                  ^
/home/altizure/xuyang/graph-cut-ransac/src/pygcransac/include/neighborhood_graph.h:59:4: warning:   when initialized here [-Wreorder]
    NeighborhoodGraph() : initialized(false),
    ^
/home/altizure/xuyang/graph-cut-ransac/src/pygcransac/include/neighborhood_graph.h: In instantiation of ‘gcransac::neighborhood::NeighborhoodGraph<_DataContainer>::NeighborhoodGraph(const _DataContainer*) [with _DataContainer = cv::Mat]’:
/home/altizure/xuyang/graph-cut-ransac/src/pygcransac/include/grid_neighborhood_graph.h:178:33:   required from here
/home/altizure/xuyang/graph-cut-ransac/src/pygcransac/include/neighborhood_graph.h:53:11: warning: ‘gcransac::neighborhood::NeighborhoodGraph<cv::Mat>::neighbor_number’ will be initialized after [-Wreorder]
    size_t neighbor_number;
           ^
/home/altizure/xuyang/graph-cut-ransac/src/pygcransac/include/neighborhood_graph.h:50:34: warning:   ‘const cv::Mat* const gcransac::neighborhood::NeighborhoodGraph<cv::Mat>::container’ [-Wreorder]
    const _DataContainer  * const container;
                                  ^
/home/altizure/xuyang/graph-cut-ransac/src/pygcransac/include/neighborhood_graph.h:64:4: warning:   when initialized here [-Wreorder]
    NeighborhoodGraph(const _DataContainer * const container_) :
    ^
CMakeFiles/SampleProject.dir/build.make:62: recipe for target 'CMakeFiles/SampleProject.dir/examples/cpp_example.cpp.o' failed
make[2]: *** [CMakeFiles/SampleProject.dir/examples/cpp_example.cpp.o] Error 1
CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/SampleProject.dir/all' failed
make[1]: *** [CMakeFiles/SampleProject.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

截屏2020-09-10 下午4 27 00

I am using C++17 and my gcc version is 9.0. Could you help with that?

As I see it has problems with the constexpr if. You need C++ 17, to compile it.

Hi Thanks for your quick reply. I have set C++17 during make but when trying to install the python package it still shows this error. How could I set C++17 when installing the python package?

Have you solved this problem? I also have this failure