Important: Please read the Qt Code of Conduct -

Qtcreator under Wine ( MinGw compilant ) error report

  • Hello, I am trying to test OpenCV with QtCreator, I`ve followed some examples, that supposedly should work, but the console shows me a strange error.
    Here is the pro. file:
    @TEMPLATE = app
    QT += core
    QT -= gui
    CONFIG += console
    CONFIG -= app_bundle

    TEMPLATE = app
    win32 {

    message("*using settings for windows")
    INCLUDEPATH += "Z:\\home\\ilian\\OpenCV_WINE\\opencv\\build\\include" \
                    "Z:\\home\\ilian\\OpenCV_WINE\\opencv\\build\\include\\opencv" \
    LIBS += -L "Z:\\home\\ilian\\OpenCV_WINE\\opencv\\build\\x86\\mingw\\lib" \
            -lopencv_core243 \
            -lopencv_highgui243 \


    SOURCES += main.cpp


    and the main.c fie:
    @#include "opencv2/highgui/highgui.hpp"
    #include <QString>
    #include <QCoreApplication>
    #include <QDebug>

    using namespace cv;

    int main(int argc, char** argv)

    QCoreApplication app(argc, argv);
    QString vlad ("Z:\\home\\ilian\\vladi.jpg");
    Mat im = imread(vlad.toStdString(), 1);
    qDebug() << vlad;
    if ( im.empty() ) {
        return -1;
    imshow("image", im);
    return app.exec();


    The error shown by running (release or debug) is:
    @terminate called after throwing an instance of 'std::length_error'
    what(): basic_string::assign@

  • Moderators


    Using Wine adds extra complexity.

    What happens if you develop directly in Windows? Or if you download the Linux libraries?

  • I don`t have windows right now, and for linux I have no problems, I need the windows testings and builds because I am making a camera software under opencv.

Log in to reply