Qt5-Windows:Windows找不到可执行文件 [英] Qt5 - Windows :Windows cannot find executable
问题描述
我正在尝试使用 Windows 10
和 Qt5.12
建立一个项目。该小程序正在使用,其目的是提供一个.pri文件,该链接易于使用.pro链接到任何项目。为此,您必须执行以下步骤:
- 下载项目
- 添加
include(/path/of/SMTPEmail.pri)
到您的.pro - 使用
#include< SmtpMime>
I am trying to build a project using Windows 10
and Qt5.12
. The small program is using the smtp
protocol available here. I can confirm that on my Windows I have the OpenSSL 1.1.1c 28 May 2019. On my Ubuntu 19.04 the same exact program compiles and run as usual but not on Windows.
I git clone
my repository into Windows
, followed successfully this post and the program builds correctly.
The problem is that when I run it, it cannot find the executable
and is asking for it as it is possible to see from the print screen below:
here is my .pro
file:
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
DEFINES += SMTP_BUILD
# You can also make your code fail to compile if it uses 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
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 =
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
On my Desktop it is created automatically the build
folder and thought that the executable would have been here. Below I Am also attaching a print screen of what is inside the build
folder:
Originally this project was deployed on Ubuntu
and that gave me no problem. I git clone
that repo into my Windows
, added the missing SMTP_BUILD
but I can't fine the executable that the window in the print screen is asking. What am I missing for this final step?
Thank you very much for pointing in the right direction.
As shown in the image of your .pro you are using TEMPLATE = lib
whose objective is to create a library whose product is a .dll, .so, etc. that is not an .exe.
If you want to generate an executable you must use:
TEMPLATE = app
Plus:
To make it easier to include the library in your project, I have created this project whose objective is to provide a .pri that is easy to link to any project with .pro. To do this you must follow the following steps:
- Download the project
- Add
include(/path/of/SMTPEmail.pri)
to your .pro - Includes using
#include <SmtpMime>
这篇关于Qt5-Windows:Windows找不到可执行文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!