openSSL mac 未定义符号
我正在为 MAC 开发一个 TLS 客户端,并且正在 MACOSX 上构建我的项目(在 Linux 上运行得很好),尤其是使用 openssl 库。
这是我的控制台错误,希望您能帮助我处理:
gcc -lpthread -o *.o /opt//local/var/macports/software/openssl97/0.9.7m_0/opt/local/lib/openssl97/lib/libssl.a /opt//local/var/macports/software/openssl97/0.9.7m_0/opt/local/lib/openssl97/lib/libcrypto.a -ldl
Undefined symbols:
"_SSL_CTX_set_info_callback", referenced from:
_MTLSServer_Setup in MTLSServer.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [mtls_server] Error 1
感谢您的帮助
I'm developing a TLSclient for MAC, and I'm having a little building my project on MACOSX (working very well on linux) and most particulary in using openssl libs.
Here's my console error I hope you could help me deal with:
gcc -lpthread -o *.o /opt//local/var/macports/software/openssl97/0.9.7m_0/opt/local/lib/openssl97/lib/libssl.a /opt//local/var/macports/software/openssl97/0.9.7m_0/opt/local/lib/openssl97/lib/libcrypto.a -ldl
Undefined symbols:
"_SSL_CTX_set_info_callback", referenced from:
_MTLSServer_Setup in MTLSServer.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [mtls_server] Error 1
Thanks for your help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 OpenSSL 0.9.7 中
SSL_CTX_set_info_callback
是一个宏,并且您的代码正在尝试链接到一个函数。这可能意味着您没有正确的标头路径。我对命令行中的其他事情有点困惑:
-o *.o
似乎是一个错误,它应该是-o some *.o
-lpthread
参数应该在 libcrypto 之后。In OpenSSL 0.9.7
SSL_CTX_set_info_callback
is a macro, and your code is trying to link to a function. This probably means you don't have the correct path to the headers.I'm a little puzzled for other things in your command line:
-o *.o
seems to be an error it should be-o something *.o
-lpthread
argument should be after libcrypto.