Открытые вопросы установки CV. Mingw проблемы с ++ ошибка - PullRequest
0 голосов
/ 30 апреля 2020

после использования cmake в моей папке сборки opencv я использовал cmd для запуска mingw32-make и получил следующую ошибку:

In file included from C:\opencv\sources\modules\core\src\utils\logtagconfigparser.hpp:14,
                 from C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:6:
C:/opencv/sources/modules/core/include/opencv2/core/utils/logtag.hpp:18:5: error: 'LogLevel' does not name a type
     LogLevel level;
     ^~~~~~~~
C:/opencv/sources/modules/core/include/opencv2/core/utils/logtag.hpp:20:38: error: 'LogLevel' has not been declared
     inline LogTag(const char* _name, LogLevel _level)
                                      ^~~~~~~~
C:/opencv/sources/modules/core/include/opencv2/core/utils/logtag.hpp: In constructor 'cv::utils::logging::LogTag::LogTag(const char*, int)':
C:/opencv/sources/modules/core/include/opencv2/core/utils/logtag.hpp:22:11: error: class 'cv::utils::logging::LogTag' does not have any field named 'level'
         , level(_level)
           ^~~~~
In file included from C:\opencv\sources\modules\core\src\utils\logtagconfigparser.hpp:15,
                 from C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:6:
C:\opencv\sources\modules\core\src\utils\logtagconfig.hpp: At global scope:
C:\opencv\sources\modules\core\src\utils\logtagconfig.hpp:20:5: error: 'LogLevel' does not name a type
     LogLevel level;
     ^~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfig.hpp:34:48: error: 'LogLevel' has not been declared
     LogTagConfig(const std::string& _namePart, LogLevel _level, bool _isGlobal = false,
                                                ^~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfig.hpp: In constructor 'cv::utils::logging::LogTagConfig::LogTagConfig()':
C:\opencv\sources\modules\core\src\utils\logtagconfig.hpp:27:11: error: class 'cv::utils::logging::LogTagConfig' does not have any field named 'level'
         , level()
           ^~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfig.hpp: In constructor 'cv::utils::logging::LogTagConfig::LogTagConfig(const string&, int, bool, bool, bool)':
C:\opencv\sources\modules\core\src\utils\logtagconfig.hpp:37:11: error: class 'cv::utils::logging::LogTagConfig' does not have any field named 'level'
         , level(_level)
           ^~~~~
In file included from C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:6:
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.hpp: At global scope:
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.hpp:24:32: error: expected ')' before 'defaultUnconfiguredGlobalLevel'
     LogTagConfigParser(LogLevel defaultUnconfiguredGlobalLevel = LOG_LEVEL_VERBOSE);
                       ~        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                )
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.hpp:40:49: error: 'LogLevel' has not been declared
     void parseWildcard(const std::string& name, LogLevel level);
                                                 ^~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.hpp:41:22: error: 'LogLevel' was not declared in this scope
     static std::pair<LogLevel, bool> parseLogLevel(const std::string& s);
                      ^~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.hpp:41:36: error: template argument 1 is invalid
     static std::pair<LogLevel, bool> parseLogLevel(const std::string& s);
                                    ^
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.hpp:42:33: error: 'LogLevel' has not been declared
     static std::string toString(LogLevel level);
                                 ^~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:12:39: error: expected constructor, destructor, or type conversion before '(' token
 LogTagConfigParser::LogTagConfigParser(LogLevel defaultUnconfiguredGlobalLevel)
                                       ^
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp: In member function 'void cv::utils::logging::LogTagConfigParser::parseNameAndLevel(const string&)':
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:105:25: error: request for member 'second' in 'parsedLevel', which is of non-class type 'int'
         if (parsedLevel.second)
                         ^~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:108:43: error: request for member 'first' in 'parsedLevel', which is of non-class type 'int'
             parseWildcard("", parsedLevel.first);
                                           ^~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:132:21: error: request for member 'second' in 'parsedLevel', which is of non-class type 'int'
     if (parsedLevel.second)
                     ^~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:134:59: error: request for member 'first' in 'parsedLevel', which is of non-class type 'int'
         parseWildcard(s.substr(0u, colonIdx), parsedLevel.first);
                                                           ^~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp: At global scope:
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:146:65: error: 'LogLevel' has not been declared
 void LogTagConfigParser::parseWildcard(const std::string& name, LogLevel level)
                                                                 ^~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp: In member function 'void cv::utils::logging::LogTagConfigParser::parseWildcard(const string&, int)':
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:152:24: error: 'struct cv::utils::logging::LogTagConfig' has no member named 'level'
         m_parsedGlobal.level = level;
                        ^~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:158:24: error: 'struct cv::utils::logging::LogTagConfig' has no member named 'level'
         m_parsedGlobal.level = level;
                        ^~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:164:24: error: 'struct cv::utils::logging::LogTagConfig' has no member named 'level'
         m_parsedGlobal.level = level;
                        ^~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:175:24: error: 'struct cv::utils::logging::LogTagConfig' has no member named 'level'
         m_parsedGlobal.level = level;
                        ^~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp: At global scope:
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:193:11: error: 'LogLevel' was not declared in this scope
 std::pair<LogLevel, bool> LogTagConfigParser::parseLogLevel(const std::string& s)
           ^~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:193:25: error: template argument 1 is invalid
 std::pair<LogLevel, bool> LogTagConfigParser::parseLogLevel(const std::string& s)
                         ^
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp: In static member function 'static int cv::utils::logging::LogTagConfigParser::parseLogLevel(const string&)':
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:195:47: error: 'LOG_LEVEL_VERBOSE' was not declared in this scope
     const auto falseDontCare = std::make_pair(LOG_LEVEL_VERBOSE, false);
                                               ^~~~~~~~~~~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:195:47: note: suggested alternative: 'CV_LOG_LEVEL_VERBOSE'
     const auto falseDontCare = std::make_pair(LOG_LEVEL_VERBOSE, false);
                                               ^~~~~~~~~~~~~~~~~
                                               CV_LOG_LEVEL_VERBOSE
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:196:40: error: 'LogLevel' has not been declared
     const auto make_parsed_result = [](LogLevel lev) -> std::pair<LogLevel, bool>
                                        ^~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:196:67: error: 'LogLevel' was not declared in this scope
     const auto make_parsed_result = [](LogLevel lev) -> std::pair<LogLevel, bool>
                                                                   ^~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:196:67: note: suggested alternative: 'parseLogLevel'
     const auto make_parsed_result = [](LogLevel lev) -> std::pair<LogLevel, bool>
                                                                   ^~~~~~~~
                                                                   parseLogLevel
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:196:81: error: template argument 1 is invalid
     const auto make_parsed_result = [](LogLevel lev) -> std::pair<LogLevel, bool>
                                                                                 ^
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp: In lambda function:
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:198:40: error: cannot convert 'std::pair<int, bool>' to 'int' in return
         return std::make_pair(lev, true);
                                        ^
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp: In static member function 'static int cv::utils::logging::LogTagConfigParser::parseLogLevel(const string&)':
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:209:43: error: 'LOG_LEVEL_SILENT' was not declared in this scope
                 return make_parsed_result(LOG_LEVEL_SILENT);
                                           ^~~~~~~~~~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:209:43: note: suggested alternative: 'CV_LOG_LEVEL_SILENT'
                 return make_parsed_result(LOG_LEVEL_SILENT);
                                           ^~~~~~~~~~~~~~~~
                                           CV_LOG_LEVEL_SILENT
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:216:43: error: 'LOG_LEVEL_DEBUG' was not declared in this scope
                 return make_parsed_result(LOG_LEVEL_DEBUG);
                                           ^~~~~~~~~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:216:43: note: suggested alternative: 'CV_LOG_LEVEL_DEBUG'
                 return make_parsed_result(LOG_LEVEL_DEBUG);
                                           ^~~~~~~~~~~~~~~
                                           CV_LOG_LEVEL_DEBUG
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:221:43: error: 'LOG_LEVEL_SILENT' was not declared in this scope
                 return make_parsed_result(LOG_LEVEL_SILENT);
                                           ^~~~~~~~~~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:221:43: note: suggested alternative: 'CV_LOG_LEVEL_SILENT'
                 return make_parsed_result(LOG_LEVEL_SILENT);
                                           ^~~~~~~~~~~~~~~~
                                           CV_LOG_LEVEL_SILENT
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:228:43: error: 'LOG_LEVEL_ERROR' was not declared in this scope
                 return make_parsed_result(LOG_LEVEL_ERROR);
                                           ^~~~~~~~~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:228:43: note: suggested alternative: 'CV_LOG_LEVEL_ERROR'
                 return make_parsed_result(LOG_LEVEL_ERROR);
                                           ^~~~~~~~~~~~~~~
                                           CV_LOG_LEVEL_ERROR
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:235:43: error: 'LOG_LEVEL_FATAL' was not declared in this scope
                 return make_parsed_result(LOG_LEVEL_FATAL);
                                           ^~~~~~~~~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:235:43: note: suggested alternative: 'CV_LOG_LEVEL_FATAL'
                 return make_parsed_result(LOG_LEVEL_FATAL);
                                           ^~~~~~~~~~~~~~~
                                           CV_LOG_LEVEL_FATAL
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:242:43: error: 'LOG_LEVEL_INFO' was not declared in this scope
                 return make_parsed_result(LOG_LEVEL_INFO);
                                           ^~~~~~~~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:242:43: note: suggested alternative: 'CV_LOG_LEVEL_INFO'
                 return make_parsed_result(LOG_LEVEL_INFO);
                                           ^~~~~~~~~~~~~~
                                           CV_LOG_LEVEL_INFO
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:248:43: error: 'LOG_LEVEL_SILENT' was not declared in this scope
                 return make_parsed_result(LOG_LEVEL_SILENT);
                                           ^~~~~~~~~~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:248:43: note: suggested alternative: 'CV_LOG_LEVEL_SILENT'
                 return make_parsed_result(LOG_LEVEL_SILENT);
                                           ^~~~~~~~~~~~~~~~
                                           CV_LOG_LEVEL_SILENT
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:255:43: error: 'LOG_LEVEL_SILENT' was not declared in this scope
                 return make_parsed_result(LOG_LEVEL_SILENT);
                                           ^~~~~~~~~~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:255:43: note: suggested alternative: 'CV_LOG_LEVEL_SILENT'
                 return make_parsed_result(LOG_LEVEL_SILENT);
                                           ^~~~~~~~~~~~~~~~
                                           CV_LOG_LEVEL_SILENT
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:271:43: error: 'LOG_LEVEL_WARNING' was not declared in this scope
                 return make_parsed_result(LOG_LEVEL_WARNING);
                                           ^~~~~~~~~~~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:271:43: note: suggested alternative: 'CV_LOG_LEVEL_WARN'
                 return make_parsed_result(LOG_LEVEL_WARNING);
                                           ^~~~~~~~~~~~~~~~~
                                           CV_LOG_LEVEL_WARN
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp: At global scope:
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:282:42: error: 'std::__cxx11::string cv::utils::logging::LogTagConfigParser::toString' is not a static data member of 'class cv::utils::logging::LogTagConfigParser'
 std::string LogTagConfigParser::toString(LogLevel level)
                                          ^~~~~~~~
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:282:42: error: 'LogLevel' was not declared in this scope
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:282:42: note: suggested alternative: 'parseLogLevel'
 std::string LogTagConfigParser::toString(LogLevel level)
                                          ^~~~~~~~
                                          parseLogLevel
C:\opencv\sources\modules\core\src\utils\logtagconfigparser.cpp:283:1: error: expected ',' or ';' before '{' token
 {
 ^
mingw32-make[2]: *** [modules\core\CMakeFiles\opencv_core.dir\build.make:1258: modules/core/CMakeFiles/opencv_core.dir/src/utils/logtagconfigparser.cpp.obj] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:2318: modules/core/CMakeFiles/opencv_core.dir/all] Error 2
mingw32-make: *** [Makefile:182: all] Error 2

Пожалуйста, как мне решить эту проблему и что такое LogLevel ?. Сначала я использовал Mingw, затем столкнулся с проблемой «мьютекса». Поэтому я перешел на Mingw64, чтобы решить ее, и я пришел к этой проблеме. Есть ли библиотека, которую мне не хватает, потому что я не нашел, что такое LogLevel.

...