【问题标题】:Qt Deployment error 0xc0000007b on WindowsWindows 上的 Qt 部署错误 0xc0000007b
【发布时间】:2023-03-03 12:31:01
【问题描述】:

我有一个 Qt 5.12 Windows 应用程序。我正在使用 Qt Creator 和 Mingw 64 位。 我已经通过 windeployqt.exe 部署了该应用程序。当我启动它时,该应用程序需要 libgcc_s_seh-1.dll 文件。将其粘贴到目录后,出现 0xc000007b 错误。我运行了 Dependency Walker,它给了我以下错误:

Error: At least one required implicit or forwarded dependency was not found.
Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.
Error: Modules with different CPU types were found.
Error: A circular dependency was detected.
Warning: At least one delay-load dependency module was not found.
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.

这是我的 .pro 文件

QT += core gui network

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = Control
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
QMAKE_LFLAGS += -static-libgcc


##CONFIG += c++11
##QMAKE_CXXFLAGS += -std=c++0x
SOURCES += \
        main.cpp \
        mainwindow.cpp

HEADERS += \
        mainwindow.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

有人可以帮助我吗?非常感谢。

【问题讨论】:

    标签: qt


    【解决方案1】:

    我过去也遇到过类似的问题,但我不太确定是不是同一个原因,因为我正在使用 MVSC 进行编译。

    在我的例子中,应用程序内部链接 x86 依赖文件。我做了download 并安装了 x64 依赖文件并链接到 x64 文件。

    无论如何,旧版本的 Dependency Walker 不知道在处理 64 位 EXE 或 DLL 时像 Windows 那样跳过 PATH 中的 32 位 DLL,因此有些错误并不真正相关。您可以在此post 中找到更多信息。

    如果问题仍然存在,请尽量避免使用静态版本的 libgcc,根据 post。它不是为静态链接而设计的。

    ...
    #QMAKE_LFLAGS += -static-libgcc
    ...
    

    【讨论】:

      【解决方案2】:

      当编译的应用程序看不到Qtdlls 时,我收到了该错误,因此请检查您的路径。也可能是找不到其他的gccdll,比如libwinpthread-1.dll

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-05-19
        • 2011-09-27
        • 2014-04-06
        • 1970-01-01
        相关资源
        最近更新 更多