当前位置: 技术问答>linux和unix
关于openssl编程问题
来源: 互联网 发布时间:2015-11-23
本文导语: 我在Linux下用openssl API 编程,用系统默安装的openssl ,在命令行下用openssl没问题.但是用gcc编译程序时总是出现下面的问题: [root@localhost program]# gcc -o openssl openssl.c -L /usr/local/ssl/lib /tmp/cc8DH5Ds.o: In function `main': /tmp/...
我在Linux下用openssl API 编程,用系统默安装的openssl ,在命令行下用openssl没问题.但是用gcc编译程序时总是出现下面的问题:
[root@localhost program]# gcc -o openssl openssl.c -L /usr/local/ssl/lib
/tmp/cc8DH5Ds.o: In function `main':
/tmp/cc8DH5Ds.o(.text+0x7): undefined reference to `ERR_load_BIO_strings'
/tmp/cc8DH5Ds.o(.text+0xc): undefined reference to `SSL_load_error_strings'
/tmp/cc8DH5Ds.o(.text+0x11): undefined reference to `OpenSSL_add_all_algorithms'
/tmp/cc8DH5Ds.o(.text+0x1e): undefined reference to `BIO_new_connect'
/tmp/cc8DH5Ds.o(.text+0x3b): undefined reference to `BIO_ctrl'
collect2: ld returned 1 exit status
无论是 -l ssl 还是 -L /usr/local/ssl都不行,总是这个错误提示.清高手帮忙解决一下.谢谢了!!!
[root@localhost program]# gcc -o openssl openssl.c -L /usr/local/ssl/lib
/tmp/cc8DH5Ds.o: In function `main':
/tmp/cc8DH5Ds.o(.text+0x7): undefined reference to `ERR_load_BIO_strings'
/tmp/cc8DH5Ds.o(.text+0xc): undefined reference to `SSL_load_error_strings'
/tmp/cc8DH5Ds.o(.text+0x11): undefined reference to `OpenSSL_add_all_algorithms'
/tmp/cc8DH5Ds.o(.text+0x1e): undefined reference to `BIO_new_connect'
/tmp/cc8DH5Ds.o(.text+0x3b): undefined reference to `BIO_ctrl'
collect2: ld returned 1 exit status
无论是 -l ssl 还是 -L /usr/local/ssl都不行,总是这个错误提示.清高手帮忙解决一下.谢谢了!!!
|
-lssl,中间没有空格。