gpt4 book ai didi

c++ - Qt可执行错误-dll库

转载 作者:行者123 更新时间:2023-11-30 02:47:11 24 4
gpt4 key购买 nike

从 QtCreator 执行时完美运行的 Qt 应用程序,当我尝试从调试文件夹(没有 QtCreator)执行它时不会运行。它需要很多 .dll 文件,我一个一个地下载了它们,并添加到调试文件夹中。现在我得到了错误:

The program can't start because libwinpthread-1.dll is missing from your computer.
Try reinstalling the program to fix this problem.

我在 Internet 上的任何地方都找不到 libwinpthread-1.dll。我做错了什么?

可执行文件的路径是:

C:\Qt\Tools\QtCreator\bin\build-SimpleText1_3-Desktop_Qt_5_2_1_MinGW_32bit\Debug

项目文件:

#-------------------------------------------------
#
# Project created by QtCreator 2014-04-04T14:29:48
#
#-------------------------------------------------

QT += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = SimpleText1_3
TEMPLATE = app


SOURCES += main.cpp\
mainwindow.cpp

HEADERS += mainwindow.h

FORMS += mainwindow.ui
CONFIG += console c++11
QMAKE_CXXFLAGS += -std=c++11

和 main.cpp:

#include "mainwindow.h"
#include <QApplication>

int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();

return a.exec();
}

最佳答案

当您在 Qt Creator 中运行您的应用程序时,一切都很好,但是当您从调试文件夹运行您的 .exe 文件时,您会收到 dll 丢失错误。这是真的!首先将 Qt Creator 设置为 Release 模式。您必须将这些 dll 和文件夹复制到 Release 文件夹:

platforms --> Folder
icudt52.dll
icuin52.dll
icuuc52.dll
msvcp110.dll
msvcr110.dll
Qt5Core.dll
Qt5Gui.dll
Qt5Widgets.dll

以上 dll 适用于 Visual Studio 编译器和仅核心和 GUI 库。

祝你好运。亚阿里。

关于c++ - Qt可执行错误-dll库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22896631/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com