链接 OpenSSL 时未定义对 t1sl_steup_key_block 的引用 [英] Undefined reference to t1sl_steup_key_block when linking OpenSSL

查看:13
本文介绍了链接 OpenSSL 时未定义对 t1sl_steup_key_block 的引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在将 OpenSSL 库链接到现有项目时遇到问题.我哪里弄错了?

I got a problem of linking an OpenSSL library into an existing project. Where I do get it wrong?

以下是我遵循的步骤.

我已经下载、配置并安装了 SSL 库.它安装在 /usr/local/ssl 中.

I have downloaded the SSL library, configured and installed it. It gets installed in /usr/local/ssl.

2) 我已经将 libcrypto.alibssl.a/usr/local/ssl/lib 复制到我的项目中,有些东西比如/mnt/linux/bla/bla/lib.

2) I have copied libcrypto.a and libssl.a from /usr/local/ssl/lib into my project, something like /mnt/linux/bla/bla/lib.

3) 然后我编辑 make 文件并在那里添加 libssl libcrpto 的路径.添加的路径是项目中的路径,如 /mnt/linux/bla/bla

3) Then I edit the make file and added path of libssl libcrpto there. The path added is one that is in project like /mnt/linux/bla /bla

3) 制作

4) 通过 slick edit 构建项目

4) build project via slick edit

当它构建时,我得到一个很长的错误链,比如

When it builds I get a long error chain, like

../lib/libssl.a(t1_enc.o) :In function 't1sl_steup_key_block: undefined ref

现在,我想将 .a 文件复制到项目中可能会出现问题.有没有其他替代方法,或者我应该使用 ln -s 将 .a 文件从 /usr/local/openssl/lib 链接到我的项目库文件夹中吗?以下是错误.

Now, I guess copying .a files into project could be problem. Is there is any alternative for that or should I use ln -s to link .a files form /usr/local/openssl/lib into my project library folder? Below is the error.

   Debug/FC5/m2pa.o  -ldl -lpthread -ltdapi ../septel/gctlib.lib ../lib/libpq.a ../asn1/lib/libasn1per.a ../mysql/lib/libmysqlclient.a     -L../lib ../asn1/lib/libasn1rt.a -lm -lcrypt -lcrypto -lssl  -rdynamic
../lib/libssl.a(ssl_lib.o): In function `SSL_set_quiet_shutdown':ssl_lib.c:(.text+0x670): multiple definition of `SSL_set_quiet_shutdown'
../mysql/lib/libmysqlclient.a(ssl.o):ssl.cpp:(.text+0x125c): first defined here
/usr/bin/ld: Warning: size of symbol `SSL_set_quiet_shutdown' changed from 45 in ../mysql/lib/libmysqlclient.a(ssl.o) to 12 in ../lib/libssl.a(ssl_lib.o)
../lib/libssl.a(ssl_lib.o): In function `SSL_get_quiet_shutdown':ssl_lib.c:(.text+0x680): multiple definition of `SSL_get_quiet_shutdown'
../mysql/lib/libmysqlclient.a(ssl.o):ssl.cpp:(.text+0x12down' changed from 35 in ../mysql/lib/libmysqlclient.a(ssl.o) to 8 in ../lib/libssl.a(ssl_lib.o)
../lib/libssl.a(ssl_err2.o): In function `SSL_load_error_strings':ssl_err2.c:(.text+0x4): undefined reference to `ERR_load_crypto_strings'
../lib/libssl.a(ssl_algs.o): In function `SSL_library_init':ssl_algs.c:(.text+0x4): undefined reference to `EVP_des_cbc'
:ssl_algs.c:(.text+0xc): undefined reference to `EVP_add_cipher'
:ssl_algs.c:(.text+0x11): undefined reference to `EVP_des_ede3_cbc'
:ssl_algs.c:(.text+0x19): undefined reference to `EVP_add_cipher'
:ssl_algs.c:(.text+0x1e): undefined reference to `EVP_idea_cbc'

推荐答案

您是否尝试过使用已安装在/usr/lib 目录中的 libssl 和 libcrypto(假设您已经为两者安装了开发包)?一旦使用默认安装编译和运行没有错误,您就可以从源代码构建新的 libssl/libcrypto(?),安装到 usr/local,然后使用库的 usr/local 版本重建.

Have you tried using the libssl and libcrypto already installed in your /usr/lib directory (assuming you've installed the dev packages for both)? Once that compiles and runs without error using the default install, you can build your new libssl/libcrypto(?) from source, install to usr/local, and rebuild using the usr/local versions of the libraries.

这篇关于链接 OpenSSL 时未定义对 t1sl_steup_key_block 的引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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