libcrypto equivalent missing on Windows

≡放荡痞女 提交于 2019-12-11 02:54:55

问题


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

I get the error:

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

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?


回答1:


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



来源:https://stackoverflow.com/questions/19321982/libcrypto-equivalent-missing-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!