Windows上缺少libcrypto等效文件 [英] libcrypto equivalent missing on Windows

查看:489
本文介绍了Windows上缺少libcrypto等效文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个需要在Windows7上编译的C文件.我已经为gcc安装了MinGW.我还需要OpenSSL,因此请遵循他们网站上的链接,并从Shining Light Productions下载完整的开发人员软件包(以及MS的64位Redistro软件包).

I have a C file that I need compiled on Windows7. I have installed MinGW for gcc. I also need OpenSSL, so followed the links from their site and downloaded the full developer package from Shining Light Productions (along with the 64-bit Redistro package from MS).

当我尝试使用此命令编译文件时:

When I try to compile my file using this command:

gcc -D_WIN32 -O2 -shared -Wl,--kill-at -lcrypto -I%JAVA_HOME%\include -I%JAVA_HOME%\include\win32 -IC:\OpenSSL-Win64\include -LC:\OpenSSL-Win64\lib -lm -std=c99 osaccess.c -o libosaccess.dll

我得到了错误:

c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lcrypto
collect2.exe: error: ld returned 1 exit status

我发现特别奇怪的是错误中使用了unix样式的正斜杠.同样,路径是正确的,但情况并非如此.有效路径为C:\MinGW\bin...,我也找不到任何加密库(libcrypto.*或crypt * lib.*),所以我想这就是为什么它找不到-lcrypto的原因.我以为这将随完整安装一起提供.以前有没有其他人遇到过这种情况,或者知道为什么会发生这种情况?

What I find particularly peculiar, is the unix-style forward slashes used in the error. Also, the path is correct, but the case is not. The valid path is C:\MinGW\bin... I also cannot find any crypto library (either libcrypto.* or crypt*lib.*) anywhere, so I guess this is why it cannot find -lcrypto. I would've thought that this would've come with the full install. Has anyone else encountered this before, or know of why it may be happening?

推荐答案

发光"发行版的正确库名称是libeay32(位于lib/libeay32.lib).该库对应于libcrypto.

The correct library name for the Shining Light distribution is libeay32 (found at lib/libeay32.lib). This library corresponds to libcrypto.

这篇关于Windows上缺少libcrypto等效文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆