0

我添加了一系列错误-l ssl and -l crypto。但是我不知道我需要安装哪个版本库

/usr/include/boost/asio/ssl/detail/openssl_init.hpp:48: undefined reference to `SSL_library_init'
/usr/include/boost/asio/ssl/detail/openssl_init.hpp:49: undefined reference to `SSL_load_error_strings'
/usr/include/boost/asio/ssl/detail/openssl_init.hpp:50: undefined reference to `SSL_library_init'
/usr/include/boost/asio/ssl/detail/openssl_init.hpp:52: undefined reference to `CRYPTO_num_locks'
/usr/include/boost/asio/ssl/detail/openssl_init.hpp:55: undefined reference to `CRYPTO_set_locking_callback'
/usr/include/boost/asio/ssl/detail/openssl_init.hpp:56: undefined reference to `CRYPTO_set_id_callback'
/usr/include/boost/asio/ssl/detail/openssl_init.hpp:48: undefined reference to `SSL_library_init'
/usr/include/boost/asio/ssl/detail/openssl_init.hpp:49: undefined reference to `SSL_load_error_strings'

有很多选择,例如

Note, selecting 'libss7-dbg' for regex 'libssl*'
Note, selecting 'libssl0.9.8-dbg' for regex 'libssl*'
Note, selecting 'libss7-dev' for regex 'libssl*'
Note, selecting 'libssl0.9.8' for regex 'libssl*'
Note, selecting 'libss2' for regex 'libssl*'
Note, selecting 'libssm-dev' for regex 'libssl*'
Note, selecting 'libssl' for regex 'libssl*'
Note, selecting 'libssh-4' for regex 'libssl*'
Note, selecting 'libssh-2-dev' for regex 'libssl*'
Note, selecting 'libssh-2-doc' for regex 'libssl*'
Note, selecting 'libssl1.0.0' for regex 'libssl*'
Note, selecting 'libsscm3' for regex 'libssl*'
Note, selecting 'libssl-ocaml-dev' instead of 'libssl-ocaml-dev-l8h98'
Note, selecting 'libssl-ocaml' instead of 'libssl-ocaml-l8h98'
Note, selecting 'libssreflect-ocaml' instead of 'libssreflect-ocaml-kevs8'
Note, selecting 'libssreflect-ocaml-dev' instead of 'libssreflect-ocaml-dev-kevs8'
Note, selecting 'python-libssh2' instead of 'python2.7-libssh2'
libss2 is already the newest version.

Note, selecting 'libcryptokit-ocaml' for regex 'libcrypto*'
Note, selecting 'libcryptokit-ocaml-02n31' for regex 'libcrypto*'
Note, selecting 'libcryptgps-ocaml-dev' for regex 'libcrypto*'
Note, selecting 'libcrypt-blowfish-perl' for regex 'libcrypto*'
Note, selecting 'libcrypt-saltedhash-perl' for regex 'libcrypto*'
Note, selecting 'libcrypt-gcrypt-perl' for regex 'libcrypto*'
Note, selecting 'libcryptui' for regex 'libcrypto*'
Note, selecting 'libcrypt-generatepassword-perl' for regex 'libcrypto*'
Note, selecting 'libcrypt-dh-gmp-perl' for regex 'libcrypto*'
Note, selecting 'libcrypt-cbc-perl' for regex 'libcrypto*'
Note, selecting 'libcrypt-dsa-perl' for regex 'libcrypto*'
Note, selecting 'libcrypt-dh-perl' for regex 'libcrypto*'
Note, selecting 'libcrypt-openssl-bignum-perl' for regex 'libcrypto*'
Note, selecting 'libcryptgps-ocaml-dev' instead of 'libcryptgps-ocaml-dev-1zmb9'
Note, selecting 'libcryptokit-ocaml' instead of 'libcryptokit-ocaml-02n31'
Note, selecting 'libcryptokit-ocaml-dev' instead of 'libcryptokit-ocaml-dev-02n31'

g++ -pthread -l ssl -lcrypto IpcManagerMain.cpp -o IpcManagerMain.o  -lentity++ -lpersistence++ -lplatform++ -lreflection++ -lmonitor++ -lmeta++ -lipc++ -lbroadcast++ -lutilities++ -L/usr/lib          -lboost_serialization -lboost_thread-mt -lboost_date_time -lboost_iostreams -lboost_program_options -lboost_filesystem -lboost_system

还有更多,但我已经缩短了。有人可以指出我正确的方向吗?

4

1 回答 1

1

想象一下(虚构的)链接器试图链接这些模块:

link moda modb modc modd

链接器不会(出于效率原因)记录它看到的所有符号moda以尝试将它们与modb. 例如,如果是一个巨大的库,那么如果在整个过程中记住moda所有符号,则链接过程会变得非常慢(并且消耗内存) 。moda

结果,链接器总是只记住(到目前为止)丢失的符号,并尝试在随后出现的模块中找到它们。请注意,这仅适用于库。这是因为同一库/应用程序的对象可能具有循环依赖关系。

这意味着例如,仅在和而不是在(再次,如果和是库)modb中搜索缺少的符号。modcmoddmodamodamodcmodd

因此,如果您modx使用了 的符号,那么您必须链接命令中mody提及。mody modx

例如,如果您有文件和main.o,那么您需要像这样编写链接命令:funcs.olibmatrix.a

gcc funcs.o main.o -lmatrix

否则,如果你写gcc -lmatrix funcs.o main.o, 的符号libmatrix.a将不会被funcs.o和看到main.o

于 2012-11-29T13:25:26.327 回答