尝试在我的 Qt 项目中使用 OpenSSL,这是我的环境:
Trying to use OpenSSL in my Qt project, here is my environment:
我试图在我的代码中include
,但是,当我添加#include
在我的 main.cpp 和构建中,Qt Creator 显示以下错误:D:QtProjectsdialogsfindfilesmain.cpp:50: error: C1083: 'openssl/evp.h':No such file or directory
I'm trying to include <openssl/evp.h>
in my code, however, when I add #include <openssl/evp.h>
in my main.cpp and build, Qt Creator shows the following error: D:QtProjectsdialogsfindfilesmain.cpp:50: error: C1083: 'openssl/evp.h':No such file or directory
我已经按照这个问题中的说明进行操作:如何包含Qt 项目中的 OpenSSL
I have already followed the instructions in this question: How to Include OpenSSL in a Qt project
我的 .pro 文件如下所示:
My .pro file looks like:
QT += widgets
HEADERS = window.h
SOURCES = main.cpp
window.cpp
# install
target.path = $$[QT_INSTALL_EXAMPLES]/widgets/dialogs/findfiles
INSTALLS += target
# for openssl - I added these 2 lines
LIBS += -LC:/OpenSSL-Win32/lib -llibcrypto
INCLUDEPATH += C:/OpenSSL-Win32/include
请帮我解决这个问题.
将此作为答案发布,因为我很确定我想通了.
Posting this as an answer because iam pretty sure i figured it out.
你必须在构建之前运行 Qmake,否则你的 pro 文件中的更改不会受到影响.由于 Qmake 正在将您的 pro 文件编译为 makefile
You have to run Qmake before building, otherwise changes in your pro File will not be affected. Since Qmake is compiling your pro File into a makefile
构建->运行 QMake
为我的 OpenSSL 库工作.
Worked for my OpenSSL library.
祝你好运!
这篇关于如何在 Qt 中实现 OpenSSL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!