【发布时间】:2017-09-09 03:22:12
【问题描述】:
尝试在我的 Qt 项目中使用 OpenSSL,这是我的环境:
- 操作系统:Win7 32位
- Qt:Qt Creator 4.2.1 社区
- Qt 工具包:Qt_5_8_0_MSVC2015_32bit2
- Openssl:Win32 OpenSSL v1.1.0e,下载表格this site
我试图在我的代码中使用include <openssl/evp.h>,但是,当我在 main.cpp 中添加#include <openssl/evp.h> 并构建时,Qt Creator 显示以下错误:D:\QtProjects\dialogs\findfiles\main.cpp:50: error: C1083: 'openssl/evp.h':No such file or directory
我已经按照这个问题的说明进行操作:How to Include OpenSSL in a Qt project
我的 .pro 文件如下所示:
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
请帮我解决这个问题。
【问题讨论】:
-
C:/OpenSSL-Win32/include/openssl/evp.h存在吗? -
是的,它存在。
-
想知道我的问题是否与我在 D:Qt 中安装 Qt 而不是 C:Qt...
-
这应该不是问题。尝试将
C:/xxx更改为C:\xxx? -
将 INCLUDEPATH 从 C:/xxx 更改为 C:\xxx,仍然出错。
标签: c++ windows qt ssl openssl