【问题标题】:Segmentation fault - OpenCV & Qt in Netbeans on Ubuntu分段错误 - Ubuntu 上 Netbeans 中的 OpenCV 和 Qt
【发布时间】:2016-09-01 17:46:34
【问题描述】:

我正在尝试使用 OpenCV 2.4(处理数据)、Netbeans(作为我的 IDE)和 Qt Designer 4.8.6(作为我的 GUI 设计器)在 C++ 中创建人脸识别软件。

当我运行我的代码时,它返回以下错误:

运行完成;分段故障;核心转储;

这是我的代码:

#include <QApplication>
#include <qt5/QtWidgets/qwidget.h>
#include <opencv2/opencv.hpp>

using namespace std;

int main(int argc, char *argv[]) {
    // initialize resources, if needed
    QApplication app(argc, argv);
    cv::VideoCapture cap(0);
    // create and show your widgets here

    return app.exec();
}

这里可能有什么问题?当我删除 cv::VideoCapture cap(0) 时,我的程序运行没有错误,所以我认为问题就在那里。

【问题讨论】:

  • 请在您的问题中包含堆栈跟踪。

标签: c++ qt opencv netbeans segmentation-fault


【解决方案1】:

解决了这个问题!您只需要安装 OpenCV 3.0。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-05-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多