zoukankan      html  css  js  c++  java
  • 解决更新到os x10.11后openssl头文件无法找到的问题

    os x从10.10更新到10.11后,原有代码编译报错,#include <openssl/ssl.h>等头文件无法找到: "openssl/ssl.h: No such file or directory".

    原有环境:os x10.10+Xcode6

    更新后的环境:os x10.11+Xcode7, Qt5.3.1+Qt Creator 3.3.0

    解决办法:

    1.命令行执行:xcode-select —install,安装xcode命令行工具,/usr路径下出现include目录 (如果原来/usr/include目录已经存在,跳过这一步);

       /usr/include/openssl目录里包含了相关的头文件

    2.在/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/路径下创建openssl目录;

    3.把 /usr/include/openssl路径下的所有文件拷贝到刚建立的openssl目录下;

    原因:

    os x10.11开始,苹果sdk中不再提供openssl,在Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include路径下是找不到原有的openssl目录的。

    "

    Sadly, it looks like we're not supposed to use it any more.  As you say, it's included in the 10.10 SDK, but is deliberately missing from the 10.11 SDK.

    http://lists.apple.com/archives/macnetworkprog/2015/Jun/msg00025.html

    "

    参考:

    1.https://forums.developer.apple.com/thread/3897

    2.http://stackoverflow.com/questions/14655154/mac-os-x-lion-does-not-have-usr-include-folder

     

    另外升级后,Qt Creator中编译会报找不到<sys/time.h>等系统头文件,修改~/Qt5.3.1/5.3/clang_64/mkspecs/qdevice.pri文件,把macsox10.10改为macosx10.11即可以解决问题。

  • 相关阅读:
    数据结构 树(下)
    数据结构 树(上)
    Python Scrapy爬虫(上)
    线程的生命周期
    多线程-方式二实现Runnable接口方式
    Thread类中的常用的方法及概述
    多线程-方式一继承Thread方式
    14: 字母的前趋或后继
    13: A+B
    12: 成绩转换
  • 原文地址:https://www.cnblogs.com/bugchecker/p/openssl_head_files_not_found_after_upgrading_to_osx_1011.html
Copyright © 2011-2022 走看看