• Mac电脑使用万能头文件教程(详细)


    参考:https://blog.csdn.net/weixin_46522531/article/details/126292477
    预计阅读+操作时间:5分钟
    Mac电脑由于使用的是苹果自己的编译器,很多头文件不支持,像万能头就是其中的一员。万能头可以为我们节省很多时间,减少很多不必要的麻烦。本文将介绍通过修改文件使Mac电脑能够使用万能头。

    第一步
    在这里插入图片描述
    打开访达

    第二步
    在这里插入图片描述
    选择前往,点击前往文件夹

    第三步
    在这里插入图片描述
    输入:
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
    并按下换行

    第四步
    在这里插入图片描述
    选择c++

    第五步
    在这里插入图片描述
    选择v1

    第六步
    在这里插入图片描述
    有没有发现很多熟悉的朋友?

    在该目录下创建文件夹,并将其命名为bits
    在这里插入图片描述
    第七步
    在这里插入图片描述
    创建文件名为stdc++.h,并将其放入bits文件夹 ,在文件内输入以下内容

    // C++ includes used for precompiling -*- C++ -*-
     
    // Copyright (C) 2003-2014 Free Software Foundation, Inc.
    //
    // This file is part of the GNU ISO C++ Library.  This library is free
    // software; you can redistribute it and/or modify it under the
    // terms of the GNU General Public License as published by the
    // Free Software Foundation; either version 3, or (at your option)
    // any later version.
     
    // This library is distributed in the hope that it will be useful,
    // but WITHOUT ANY WARRANTY; without even the implied warranty of
    // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    // GNU General Public License for more details.
     
    // Under Section 7 of GPL version 3, you are granted additional
    // permissions described in the GCC Runtime Library Exception, version
    // 3.1, as published by the Free Software Foundation.
     
    // You should have received a copy of the GNU General Public License and
    // a copy of the GCC Runtime Library Exception along with this program;
    // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
    // .
     
    /** @file stdc++.h
     *  This is an implementation file for a precompiled header.
     */
     
    // 17.4.1.2 Headers
     
    // C
    #ifndef _GLIBCXX_NO_ASSERT
    #include 
    #endif
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
     
    #if __cplusplus >= 201103L
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #endif
     
    // C++
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
     
    #if __cplusplus >= 201103L
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #endif
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    • 108
    • 109
    • 110
    • 111
    • 112
    • 113
    • 114
    • 115
    • 116

    结果
    在这里插入图片描述

  • 相关阅读:
    使用boost::serialization模块实现快速进制归档的测试程序
    学习Vue的入门方法有哪些呢?
    el-table中添加switch 且绑定值为0和1
    MarkdownPad2, CSDN及有道云笔记对数学公式的支持
    云计算:掌控未来,一触即发!
    Python 函数方法的类型注解
    static关键字
    i18n 国际化
    代码随想录算法训练营第五十三天|1143.最长公共子序列、1035.不相交的线、53. 最大子序和
    SpringBoot到底是什么?
  • 原文地址:https://blog.csdn.net/qq_21237549/article/details/132777658