我试图在我的C++应用程序中使用#include <openssl/hmac.h>。因此,我尝试遵循以下说明:

http://www.askyb.com/windows/compiling-and-installing-openssl-for-32-bit-windows/comment-page-1/#comment-47532

我成功做到了这一点:

  • 创建一个新文件夹C:\ openssl-1.0.1c
  • 从github下载1.1.0c-https://github.com/openssl/openssl/tree/91eaf079b7430cb4ebb7f3ccabe74aa383b27c4e
  • 提取到C:\openssl-1.0.1c
  • 我已下载并安装安装ActiveState Perl
  • 在我的屏幕快照中,将C:\perl\bin添加到了我的路径中-http://i.imgur.com/QOhKUwl.png
  • 创建一个新文件夹C:\openssl-1.0.1c-bin
  • 使用Win + R打开命令提示符,然后键入cmd
  • 然后粘贴引号"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\vsvars32.bat"(这是正确的路径),它存在于我的系统中
  • 它运行了,然后我做了perl Configure VC-WIN32 no-asm – -prefix=C:\openssl-1.0.1c-bin(没有引号),它告诉我ppm install dmake来获取nmake,所以我做到了-http://i.imgur.com/SuC65oo.png
  • 我根据此问题输入了nmake-https://github.com/curl/curl/issues/1002-不再可以执行nmake -f ms\ntdll.mak,这大约需要15分钟的时间
  • 它起作用了,然后我做了nmake test

  • 通过了所有测试,但是我的C:\openssl-1.0.1c-bin目录为空,并且执行#include <openssl/hmac.h>无法在我的Visual Studio中工作。

    我是写C++的新手。

    谢谢

    最佳答案

    您错过了最后一个步骤,运行此命令“nmake -f ms \ ntdll.mak install”。它将所有库复制到C:\ openssl-1.0.1g-bin。

    如果这样做,它将按预期工作。我只是在Windows 7和Visual Studio 2015中在本地尝试过,效果很好。

    关于nmake的警告是虚假的,您可以继续使用nmake ok。

    关于c++ - Visual Studio 2015 OpenSSL,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/41357374/

    10-10 21:30
    查看更多