通过修改makefile:
downCA: downCA.c
gcc downCA.c -lssl -static -o downCA
clean:
rm downCA
出现了一大堆错误:
(.text+0x19f1): undefined reference to `ERR_put_error'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(s2_srvr.o): In function `ssl2_accept':
(.text+0x19fb): undefined reference to `ERR_clear_error'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(s2_srvr.o): In function `ssl2_accept':
(.text+0x1a3e): undefined reference to `ERR_put_error'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(s2_srvr.o): In function `ssl2_accept':
(.text+0x1a76): undefined reference to `ERR_put_error'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(s2_srvr.o): In function `ssl2_accept':
(.text+0x1abe): undefined reference to `ERR_put_error'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(s2_srvr.o): In function `ssl2_accept':
(.text+0x1b10): undefined reference to `ERR_put_error'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(s2_srvr.o): In function `ssl2_accept':
(.text+0x1b5f): undefined reference to `ERR_put_error'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(s2_srvr.o)
.text+0x1ba7): more undefined references to `ERR_put_error' follow
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(s2_lib.o): In function `ssl2_write_error':
(.text+0x1ed): undefined reference to `OpenSSLDie'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(s2_lib.o): In function `ssl2_generate_key_material':
(.text+0x25c): undefined reference to `EVP_md5'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(s2_lib.o): In function `ssl2_generate_key_material':
(.text+0x267): undefined reference to `EVP_MD_CTX_init'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(s2_lib.o): In function `ssl2_generate_key_material':
(.text+0x2c6): undefined reference to `EVP_DigestUpdate'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(s2_lib.o): In function `ssl2_generate_key_material':
(.text+0x2dd): undefined reference to `EVP_DigestUpdate'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(s2_lib.o): In function `ssl2_generate_key_material':
(.text+0x2fd): undefined reference to `EVP_DigestUpdate'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(s2_lib.o): In function `ssl2_generate_key_material':
这是否说明是库本身的问题?libssl.so?libssl.a