<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[LNK1107: invalid or corrupt file cannot read 0x458]]></title><description><![CDATA[<p dir="auto">I'm pretty new to qt and i'm trying to create a widget that showing my webcam using qt and opencv. As the title has stated that i'm stuck at the LNK1107: invalid or corrupt file cannot read 0x458.  After having done some research, i discovered that this issues have been addressed in multiple topic, but not with 0x458 in particular</p>
<p dir="auto">Any aid would be greatly appriciated, from the bottom of my heart</p>
<p dir="auto">here's my code:<br />
.pro:</p>
<pre><code>#-------------------------------------------------
#
# Project created by QtCreator 2019-08-10T12:27:53
#
#-------------------------------------------------

QT       += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = TutorialOpenCV
TEMPLATE = app

# The following define makes your compiler emit warnings if you use
# any feature of Qt which has been marked as deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS

# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0

CONFIG += c++11

SOURCES += \
        main.cpp \
        mainwindow.cpp \
        myvideocapture.cpp

HEADERS += \
        mainwindow.h \
        myvideocapture.h

FORMS += \
        mainwindow.ui

# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../../opencv/build/x64/vc15/lib/ -lopencv_world451
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../../opencv/build/x64/vc15/lib/ -lopencv_world451d
else:unix: LIBS += -L$$PWD/../../../../../opencv/build/x64/vc15/lib/ -lopencv_world451

INCLUDEPATH += C:\opencv\build\x64\vc15
LIBS += C:\opencv\build\x64\vc15\lib\opencv_world451.lib
LIBS += C:\opencv\build\x64\vc15\lib\opencv_world451d.lib


INCLUDEPATH += $$PWD/../../../../../opencv/build/include
DEPENDPATH += $$PWD/../../../../../opencv/build/include


INCLUDEPATH += C:\opencv\release\install\include


LIBS += C:\opencv\release\bin\libopencv_core451.dll
LIBS += C:\opencv\release\bin\libopencv_highgui451.dll
LIBS += C:\opencv\release\bin\libopencv_imgcodecs451.dll
LIBS += C:\opencv\release\bin\libopencv_imgproc451.dll
LIBS += C:\opencv\release\bin\libopencv_features2d451.dll
LIBS += C:\opencv\release\bin\libopencv_calib3d451.dll

INCLUDEPATH += C:\opencv\release\install\include\opencv2
INCLUDEPATH += C:\opencv\release\install\include\opencv
INCLUDEPATH += C:\opencv\build\include
INCLUDEPATH += C:\opencv\release\include
LIBS += C:\opencv\release\install\x64\mingw\bin\libopencv_core451.dll
LIBS += C:\opencv\release\install\x64\mingw\bin\libopencv_highgui451.dll
LIBS += C:\opencv\release\install\x64\mingw\bin\libopencv_imgcodecs451.dll
LIBS += C:\opencv\release\install\x64\mingw\bin\libopencv_imgproc451.dll
LIBS += C:\opencv\release\install\x64\mingw\bin\libopencv_features2d451.dll
LIBS += C:\opencv\release\install\x64\mingw\bin\libopencv_calib3d451.dll
</code></pre>
<p dir="auto">myvideocapture.cpp:</p>
<pre><code>#include "myvideocapture.h"
#include &lt;QDebug&gt;

MyVideoCapture::MyVideoCapture(QObject *parent)
    : QThread { parent }
    , mVideoCap { ID_CAMERA }
{
}
void MyVideoCapture::run()
{
    if (mVideoCap.isOpened())
    {
        while (true)
        {
            mVideoCap &gt;&gt; mFrame;
            if (!mFrame.empty())
            {
                cv::rectangle(mFrame, cv::Point(10, 10), cv::Point(401, 401), cv::Scalar(0, 0, 255), 1);

                mPixmap = cvMatToQPixmap(mFrame);
                emit newPixmapCaptured();
            }
        }
    }
}

QImage MyVideoCapture::cvMatToQImage(const cv::Mat &amp;inMat)
{
    switch (inMat.type())
    {
        // 8-bit, 4 channel
        case CV_8UC4:
        {
            QImage image(inMat.data, inMat.cols, inMat.rows, static_cast&lt;int&gt;(inMat.step), QImage::Format_ARGB32);
            return image;
        }
        // 8-bit, 3 channel
        case CV_8UC3:
        {
            QImage image(inMat.data, inMat.cols, inMat.rows, static_cast&lt;int&gt;(inMat.step), QImage::Format_RGB888);
            return image.rgbSwapped();
        }
        // 8-bit, 1 channel
        case CV_8UC1:
        {
    #if QT_VERSION &gt;= QT_VERSION_CHECK(5, 5, 0)
            QImage image(inMat.data, inMat.cols, inMat.rows, static_cast&lt;int&gt;(inMat.step), QImage::Format_Grayscale8);
    #else
            static QVector&lt;QRgb&gt;  sColorTable;

            // only create our color table the first time
            if (sColorTable.isEmpty())
            {
                sColorTable.resize(256 );

                for (int i = 0; i &lt; 256; ++i )
                {
                    sColorTable[i] = qRgb(i, i, i );
                }
            }

            QImage image(inMat.data,
                         inMat.cols, inMat.rows,
                         static_cast&lt;int&gt;(inMat.step),
                         QImage::Format_Indexed8 );

            image.setColorTable(sColorTable );
    #endif
            return image;
        }
        default:
        {
            qWarning()&lt;&lt; "ASM::cvMatToQImage()- cv::Mat image type not handled in switch:" &lt;&lt; inMat.type();
            break;
        }
    }
    return QImage();
}

QPixmap MyVideoCapture::cvMatToQPixmap(const cv::Mat &amp;inMat)
{
    return QPixmap::fromImage(cvMatToQImage(inMat));
}
</code></pre>
<p dir="auto">mainwindow.cpp:</p>
<pre><code>#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "myvideocapture.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui-&gt;setupUi(this);
    mOpenCV_videoCapture = new MyVideoCapture(this);

    connect(mOpenCV_videoCapture, &amp;MyVideoCapture::newPixmapCaptured, this, [&amp;]()
    {
        ui-&gt;opencvFrame-&gt;setPixmap(mOpenCV_videoCapture-&gt;pixmap().scaled(500, 500));
    });
}

MainWindow::~MainWindow()
{
    delete ui;
    mOpenCV_videoCapture-&gt;terminate();
}

void MainWindow::on_iniciarOpenCV_button_clicked()
{
    mOpenCV_videoCapture-&gt;start(QThread::HighestPriority);
}
</code></pre>
<p dir="auto">main.cpp:</p>
<pre><code>#include "mainwindow.h"
#include &lt;QApplication&gt;

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    a.setStyle("fusion");
    MainWindow w;
    w.show();
    return a.exec();
}
</code></pre>
]]></description><link>https://forum.qt.io/topic/123981/lnk1107-invalid-or-corrupt-file-cannot-read-0x458</link><generator>RSS for Node</generator><lastBuildDate>Sat, 14 Nov 2026 04:59:32 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/123981.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 19 Feb 2021 13:57:51 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to LNK1107: invalid or corrupt file cannot read 0x458 on Fri, 19 Feb 2021 14:58:30 GMT]]></title><description><![CDATA[<p dir="auto">Double post - locked.</p>
]]></description><link>https://forum.qt.io/post/645446</link><guid isPermaLink="true">https://forum.qt.io/post/645446</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Fri, 19 Feb 2021 14:58:30 GMT</pubDate></item><item><title><![CDATA[Reply to LNK1107: invalid or corrupt file cannot read 0x458 on Fri, 19 Feb 2021 14:18:45 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/noobdude12343">@<bdi>NoobDude12343</bdi></a> Please don't double post, you have already raise this issue in <a href="https://forum.qt.io/topic/123952/qt-sigfpe-arithmetic-exception/6">this post</a>...</p>
]]></description><link>https://forum.qt.io/post/645441</link><guid isPermaLink="true">https://forum.qt.io/post/645441</guid><dc:creator><![CDATA[Pablo J. Rogina]]></dc:creator><pubDate>Fri, 19 Feb 2021 14:18:45 GMT</pubDate></item><item><title><![CDATA[Reply to LNK1107: invalid or corrupt file cannot read 0x458 on Fri, 19 Feb 2021 13:59:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/noobdude12343">@<bdi>NoobDude12343</bdi></a> Please post whole error message. It is not even clear what file causes the problem!</p>
]]></description><link>https://forum.qt.io/post/645432</link><guid isPermaLink="true">https://forum.qt.io/post/645432</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Fri, 19 Feb 2021 13:59:06 GMT</pubDate></item></channel></rss>