我在Windows上的libcrypto链接有什么问题? [英] What is wrong with my libcrypto linking on Windows?

查看:677
本文介绍了我在Windows上的libcrypto链接有什么问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图链接我的c + +程序对libcrypto库,使用Cygwin和Windows。

I am trying to link my c++ program against the libcrypto library, using Cygwin and Windows.

我在.cc文件中有这个

I have this in my .cc file

#include <openssl/dh.h>

我有头文件dh.h在usr / include / openssl

I have the header file dh.h in usr/include/openssl

而且我在/ usr / lib /中有所需的文件(libeay32.dll和ssleay32.dll),但是当我编译(使用python构建工具node-waf)时, 未定义的引用_DH_new

And I have the required files (libeay32.dll and ssleay32.dll) in /usr/lib/ however, when I build (using the python build tool node-waf), I get errors such as undefined reference to _DH_new

我已经在构建脚本的cxxflags部分尝试了很多东西,这个:

I have tried various things in the cxxflags section of the build script, which now looks like this:

ppp.cxxflags = ["-g", "-D_FILE_OFFSET_BITS=64", "-D_LARGEFILE_SOURCE", "-Wall", "-L/usr/lib", "-lssl","-llibeay32","-lssleay32"]


推荐答案

Libcrypto.so是Linux的动态链接库。
根据 Windows 您需要使用libeay32.a和ssleay32.a。
如果这不工作你必须从OpenSSL源中创建自己的库。

Libcrypto.so is Linux's dynamically linked library. According to this on Windows You need to use libeay32.a and ssleay32.a. If that doesn't work You have to make your own library from OpenSSL source.

这篇关于我在Windows上的libcrypto链接有什么问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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