3

我正在尝试在 Ubunutu 12.04 上构建 openwsman(昨天从官网下载的 2.3.0)。我按照 README.md 中的说明进行操作,在安装了几个附加软件包后,我终于得到了cmake ..成功的命令。

但是,当我运行时make,出现以下错误:

Linking C executable test_list
../libwsman_curl_client_transport.so.1.0.0: undefined reference to `X509_digest'
../libwsman_curl_client_transport.so.1.0.0: undefined reference to `SSL_CTX_set_cert_verify_callback'
../libwsman_curl_client_transport.so.1.0.0: undefined reference to `SSL_CTX_set_verify'
../libwsman_curl_client_transport.so.1.0.0: undefined reference to `EVP_sha1'
collect2: ld returned 1 exit status
make[2]: *** [src/lib/test/test_list] Error 1
make[1]: *** [src/lib/test/CMakeFiles/test_list.dir/all] Error 2

有谁知道如何解决这个问题?

4

1 回答 1

1

I have finally been able to resolve this issue. It turns out I needed to change a CMakeLists file in the openwsman library.

What I needed to change are the libraries linked with libwsman_curl_client_transport. To fix the issue open the file src/lib/CMakeLists.txt(assuming you are located in openwsman base directory) and change the line that looks like:

TARGET_LINK_LIBRARIES( wsman_curl_client_transport ${CURL_LIBRARIES})

To

TARGET_LINK_LIBRARIES( wsman_curl_client_transport ${CURL_LIBRARIES} ssl crypto)

In the openwsman distribution I have downloaded(openwsman2.3.0) this is line 53 of the file described.

In what I do here is I tell the given library to be linked with crypto and ssl too and this resolves the linker errors.

Hope this answer helps someone to resolve this issue way faster than I did.

于 2013-04-04T07:55:17.430 回答