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

news/2024/10/22 23:45:19/

参考: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
// <http://www.gnu.org/licenses/>./** @file stdc++.h*  This is an implementation file for a precompiled header.*/// 17.4.1.2 Headers// C
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

结果
在这里插入图片描述


http://www.ppmy.cn/news/1099060.html

相关文章

是的,决定放弃算法去机器学习了

可是梦想啊&#xff01;~她永存心间&#xff01;&#xff01;&#xff01; 我啊~本是执着于这些算法的怪咖&#xff0c;梦想是icpc&#xff0c;ccpc~ 可是啊~ 在以后的科研和工作中&#xff0c;这些算法很多都是用不到的&#xff0c;学习算法更重要的目的是锻炼编程能力和分析…

中秋国庆双节将至,企业如何进行软文推广?

节点营销是每个企业都会面临的课题&#xff0c;中秋国庆双节将至&#xff0c;这两个节日不仅是人们消费的高峰期&#xff0c;也是各大企业通过节日营销提高品牌知名度和美誉度的最佳时机&#xff0c;节点营销的方式之一就是软文推广&#xff0c;那么企业应该如何利用双节来进行…

【dubbo3】看懂消费者如何发现提供者

服务发现机制 服务发现是RPC框架非常重要的能力。典型的服务发现一般有两种&#xff1a;接口级服务发现、应用级服务发现。  接口级服务发现典型代表是dubbo2基于zk的服务发现机制。提供者直接向注册中心注册接口信息及地址&#xff0c;消费者通过接口从注册中心拿到对应的地址…

2.11 PE结构:添加新的节区

在可执行PE文件中&#xff0c;节&#xff08;section&#xff09;是文件的组成部分之一&#xff0c;用于存储特定类型的数据。每个节都具有特定的作用和属性&#xff0c;通常来说一个正常的程序在被编译器创建后会生成一些固定的节&#xff0c;通过将数据组织在不同的节中&…

微信小程序wx.previewImage实现图片预览

在微信小程序中&#xff0c;wx.previewImage函数用于预览图片&#xff0c;可以将一组图片以轮播的方式展示给用户&#xff0c;并支持用户手势操作进行切换。 使用wx.previewImage函数需要传入一个参数对象&#xff0c;该对象包含以下属性&#xff1a; current: String&#x…

清华开源LLM中英双语对话语言模型ChatGLM2,效果能赶超ChatGPT?

ChatGLM-6B 是一个开源的、支持中英双语的对话语言模型,基于 General Language Model (GLM) 架构,具有 62 亿参数.ChatGLM2-6B 是开源中英双语对话模型 ChatGLM-6B 的第二代版本,其第二代继承了第一代的优秀特点,并在第一代的基础上,更新了更多的新特性。 更强大的性能: C…

sonarqube版本升级

官方文档&#xff1a;Upgrade guide 步骤1、停止原有sonarqube服务&#xff0c;如果是docker部署的直接停掉容器并删除 步骤2、部署最新版sonarqube&#xff0c;保留原有配置 步骤3、访问sonarqube web 显示维护中&#xff0c;根据官方给出的升级方法&#xff0c;在sonarqub…

Java ArrayList扩容机制

来分析一下远吗吧 // 单个元素添加 public boolean add(E e) {modCount;add(e, elementData, size);return true;}// 批量add public boolean addAll(Collection<? extends E> c) {Object[] a c.toArray();modCount;int numNew a.length;if (numNew 0)return false;…