在xcode下用openssl写dh密钥交换,遇到“ld: library not found for -lcrypto”问题(已解决)

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/G_Barble/article/details/71057249

今天下午用xcode写一个特别简单的diffie-hellman密钥交换代码,参考了一堆资料,排除了逻辑和语法的错误以后依然编译不过,还有一个问题,问题截图如下:


一直提示 “ld: library not found for -lcrypto”  & “Linker command failed with exit code 1”

然后就在Google搜,在 #xhe_tmpurl http://www.cnblogs.com/zhulin/archive/2011/12/04/2275205.html  找到了问题的一个解决方法,截图如下:


然后我就想到了Xcode一直提示找不到链接库,就把openssl库文件的链接给添加上,如下图:


而且一定要注意的是  “Header Search Paths"  和 "Library Search Paths" 的路径不一样,比如在我的openssl中,头文件都保存在include文件夹内,而库文件则在lib文件夹下,如下图:


猜你喜欢

转载自blog.csdn.net/G_Barble/article/details/71057249