'std' does not name a template type异常

./cf_libs/common/feature_channels.hpp:90:21: error: 'shared_ptr' in namespace 'std' does not name a template type
         static std::shared_ptr dftFeatures(
                     ^
./cf_libs/common/feature_channels.hpp:101:21: error: 'shared_ptr' in namespace 'std' does not name a template type
         static std::shared_ptr idftFeatures(
                     ^
./cf_libs/common/feature_channels.hpp:112:52: error: 'shared_ptr' in namespace 'std' does not name a template type
         static T squaredNormFeaturesCcs(const std::shared_ptr& Af)
                                                    ^
./cf_libs/common/feature_channels.hpp:112:62: error: expected ',' or '...' before '<' token
         static T squaredNormFeaturesCcs(const std::shared_ptr& Af)
                                                              ^
./cf_libs/common/feature_channels.hpp:132:54: error: 'shared_ptr' in namespace 'std' does not name a template type
         static T squaredNormFeaturesNoCcs(const std::shared_ptr& Af)
                                                      ^
./cf_libs/common/feature_channels.hpp:132:64: error: expected ',' or '...' before '<' token
         static T squaredNormFeaturesNoCcs(const std::shared_ptr& Af)
                                                                ^
./cf_libs/common/feature_channels.hpp:147:21: error: 'shared_ptr' in namespace 'std' does not name a template type
         static std::shared_ptr mulSpectrumsFeatures(const std::shared_ptr& Af,
                     ^
./cf_libs/common/feature_channels.hpp:159:21: error: 'shared_ptr' in namespace 'std' does not name a template type
         static std::shared_ptr mulSpectrumsFeatures(const cv::Mat& Af,
                     ^
./cf_libs/common/feature_channels.hpp: In static member function 'static void cf_tracking::FeatureChannels_::mulValueFeatures(int)':
./cf_libs/common/feature_channels.hpp:55:17: error: 'm' was not declared in this scope
                 m->channels[i] *= value;
                 ^
./cf_libs/common/feature_channels.hpp:55:35: error: 'value' was not declared in this scope
                 m->channels[i] *= value;
                                   ^
./cf_libs/common/feature_channels.hpp: In static member function 'static void cf_tracking::FeatureChannels_::addFeatures(int)':
./cf_libs/common/feature_channels.hpp:62:17: error: 'A' was not declared in this scope
                 A->channels[i] += B->channels[i];
                 ^
./cf_libs/common/feature_channels.hpp:62:35: error: 'B' was not declared in this scope
                 A->channels[i] += B->channels[i];
                                   ^
./cf_libs/common/feature_channels.hpp: In static member function 'static cv::Mat cf_tracking::FeatureChannels_::sumFeatures(int)':
./cf_libs/common/feature_channels.hpp:67:27: error: 'x' was not declared in this scope
             cv::Mat res = x->channels[0].clone();
                           ^
./cf_libs/common/feature_channels.hpp: In static member function 'static cv::Mat cf_tracking::FeatureChannels_::sumFeaturesInPlace(int)':
./cf_libs/common/feature_channels.hpp:78:17: error: 'x' was not declared in this scope
                 x->channels[0] += x->channels[i];
                 ^
./cf_libs/common/feature_channels.hpp:80:20: error: 'x' was not declared in this scope
             return x->channels[0];



太多的异常可能是c++11没有引用,模板类报的错,解决:

g++ -std=c++11

下面的异常:

/home/lbg/quwutest/main.cpp:59: error: 'i' cannot appear in a constant-expression
     min(img.at>(i, j)[0], img.at>(i, j)[1]),

这个异常解决方法也是c++11

QMAKE_CXXFLAGS += -std=c++11


你可能感兴趣的:(c++基础)