【发布时间】:2014-10-08 03:51:22
【问题描述】:
我有一个类似于 Openssl how to compile a simple program? 的问题,但我使用的是 Windows 7(因此编译 reentrant.c 的建议不起作用)。我有一个来自 GnuWin32 的 OpenSSL Windows 端口,在 Qt Creator 中我尝试构建项目。在我的 .pro 文件中,我输入了以下几行:
INCLUDEPATH += C:\gnuwin32\include
LIBS += -LC:\gnuwin32\bin -lssl32
但编译器仍然写:
undefined reference to `BIO_s_file'
undefined reference to `BIO_new'
undefined reference to `BIO_ctrl'
undefined reference to `PEM_read_bio_X509'
(...)
undefined reference to `EVP_PKEY_free'
collect2.exe:-1: błąd: error: ld returned 1 exit status
我做错了什么?
编辑:
有谁知道链接器有什么问题?包含标头,LIBS += -L C:\gnuwin32\bin -lssl32 在 .pro 文件中...
【问题讨论】:
-
按这些确切名称的顺序与 -lssl 和 -lcrypto 以及 -lws2_32 和 -lgdi32 链接。现在确定为什么你有 -lssl32。它的末尾没有 32 afaik .. 除非你重命名它。
-
-lssl32可能不正确。在 Windows 上,该库被命名为libeay32.dll;它没有被命名为libssl32.dll。 -
谢谢!我使用了
-leay32,它可以工作。但是我在gnuwin32/bin目录中也有libssl32.dll,我没有重命名,所以它是什么?
标签: windows dll linker openssl