【问题标题】:error using for in qt with opencv3在带有opencv3的qt中使用for时出错
【发布时间】:2017-01-23 02:19:59
【问题描述】:

我从 MitrocontrollersAndMore 获得有关使用 c++ 进行车牌识别的源代码示例。但是我发现了一些错误。例如,我在这段代码中有错误:

for (auto &vectorOfMatchingChars : vectorOfVectorsOfMatchingCharsInScene) {                     // for each group of matching chars
        PossiblePlate possiblePlate = extractPlate(imgOriginalScene, vectorOfMatchingChars);        // attempt to extract plate

        if (possiblePlate.imgPlate.empty() == false) {                                              // if plate was found
            vectorOfPossiblePlates.push_back(possiblePlate);                                        // add to vector of possible plates
        }
    }

错误是在 ':' 标记之前的预期初始化程序,预期在输入末尾的主表达式,预期是 ';'在输入结束时等。我必须怎么做才能解决这些错误?

【问题讨论】:

  • 您已启用标准 C++11

标签: c++ qt opencv


【解决方案1】:

你应该像这样修改你的.pro ::

TEMPLATE = app
CONFIG += console c++14
CONFIG -= app_bundle
CONFIG -= qt

专注于 c++14。这将启用 C++14 版本。

由于我不知道你的 .pro 是什么样子,所以我在这里举了一个例子。

要启用 C++14,您需要专门添加这一行::

配置 += c++14

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-08-24
    • 2020-03-05
    • 1970-01-01
    • 2018-06-17
    • 2016-12-07
    • 2016-02-01
    • 2015-10-24
    相关资源
    最近更新 更多