当前位置: 技术问答>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,中间没有空格。
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。