我将要在Windows 10上部署一个小应用程序。感谢这篇文章,我成功构建和运行了应用程序,并创建了可执行文件。
但出现了一个问题,突然间有一个.dll
文件丢失了。具体地,在点击.exe
以确保应用程序工作时,出现了以下错误信息:
VCRUNTIME140D_APP.dll未找到
在我的debug文件夹中,我已经创建了.exe
文件,但不知道为什么会要求那个库。
以下是我的.pro
文件:
QT += quick quickcontrols2 concurrent network core gui
CONFIG += c++11
# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Refer to the documentation for the
# deprecated API to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
TARGET = SMTPEmail
TEMPLATE = app
DEFINES += SMTP_BUILD
#win32:CONFIG += dll
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
SOURCES += \
main.cpp \
progressbardialog.cpp \
robot.cpp \
robotmanager.cpp \
settings/emailaddress.cpp \
settings/mimeattachment.cpp \
settings/mimecontentformatter.cpp \
settings/mimefile.cpp \
settings/mimehtml.cpp \
settings/mimeinlinefile.cpp \
settings/mimemessage.cpp \
settings/mimemultipart.cpp \
settings/mimepart.cpp \
settings/mimetext.cpp \
settings/quotedprintable.cpp \
settings/smtpclient.cpp \
user.cpp \
usermanager.cpp
RESOURCES += qml.qrc
# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =
# Additional import path used to resolve QML modules just for Qt Quick Designer
QML_DESIGNER_IMPORT_PATH =
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
HEADERS += \
progressbardialog.h \
robot.h \
robotmanager.h \
settings/SmtpMime \
settings/emailaddress.h \
settings/mimeattachment.h \
settings/mimecontentformatter.h \
settings/mimefile.h \
settings/mimehtml.h \
settings/mimeinlinefile.h \
settings/mimemessage.h \
settings/mimemultipart.h \
settings/mimepart.h \
settings/mimetext.h \
settings/quotedprintable.h \
settings/smtpclient.h \
settings/smtpexports.h \
user.h \
usermanager.h
我到目前为止做了什么
1) 为了解决这个最后的问题,我进行了研究,并发现了这篇有用的文章,它还解释了主要的区别。需要注意的是,此应用程序仅在桌面上运行。
2) 我找到了vcruntime140_app.dll版本下载,并下载了缺失的库。解压并将其添加到我的调试文件夹中,如下图所示:
之后我构建和运行应用程序,但令人惊讶的是,尽管手动添加了.dll
到Debug文件夹中,我仍然得到完全相同的错误。
3) 我进行了更多的研究,发现了这个,这篇文章和这篇文章。但是所有这些都没有帮助我解决如何理解问题的问题。
4) 我还尝试安装了同样来源于第2)点的vcruntime140d.dll版本,但仍然出现相同的结果。缺失库VCRUNTIME140D_APP.dll未找到
最后要注意的一件事是:我下载并尝试了vcruntime140_app.dll,然后是vcruntime140d.dll,但如果存在的话,我无法找到vcruntime140d_app.dll。
我不明白为什么,尽管库在那里,如此也可以看到这里C:\Users\me\OneDrive\Desktop\build-signalsQML-Desktop_Qt_5_12_0_MSVC2017_64bit-Debug\vcruntime140_app.dll
,但双击可执行文件仍会给出相同的错误。
感谢您指导我解决这个问题的方向。