Xcode下使用bits/stdc++.h 头文件

bits/stdc++.h 头文件,“万能头文件”。
这个头文件包含了所有 C++ 标准库,这样我们就不用一个一个将我们需要的头文件包含进来

问题

在Xcode中,第一次用bits/stdc++.h 头文件时

解决:

在/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1目录下新建bits文件夹,再将stdc++.h头文件放置在bits文件夹下
bits/stdc++.h 的代码如下:

// 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 <cstdalign>
#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

步骤:

打开终端

cd /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1
sudo mkdir bits
cd bits
sudo touch stdc++.h
sudo vim stdc++.h

将上面bits/stdc++.h 的代码粘进去就OK了

打开一个工程运行。

解决过程中遇到的问题…

按上面的步骤,运行时可能会报错,但是看其他相关博客时候并没有看到这个问题

也没有百度到相关问题及解决。。。
我就注释掉了这一行哈哈哈哈哈
完美运行

参考博客

Xcode下使用bits/stdc++.h 头文件相关推荐

  1. bits/stdc++.h头文件总结

    目录 头文件使用方法 头文件内容 VS里面使用#include的方法 优点: 缺点: 在看一个浙大大佬的比赛答案时,发现了这么一个头文件,在C++中引用很广泛.然后查了以下,总结一下. #includ ...

  2. std.h对应linux头文件,bits/stdc++.h头文件介绍(包含源代码)

    注:转自http://blog.csdn.net/charles_dong2/article/details/56909347,同为本人写的,有部分修改. 之前在一个小OJ上刷题时发现有人是这么写的: ...

  3. MAC OS下设置bits/stdc++.h万能头文件

    在MAC下用atom写c++程序时用到万能头文件会比较方便. 准备: 下载xcode或者command line developer tools 地址:https://developer.apple. ...

  4. 超详细!关于万能头文件<bits/stdc++.h>的细节

    万能头文件引言 相信大家在C/C++中一定也遇到过这些情况: 使用系统库函数(如C++<cmath>库,C<math.h>库的开方函数double sqrt(double))和 ...

  5. MacOS Clion 使用<bits/stdc++.h>万能头提示 fatal error: ‘bits/stdc++.h‘ file not found

    MacOS Clion 使用<bits/stdc++.h>万能头提示 fatal error: 'bits/stdc++.h' file not found 百度搜了一圈答案,都大坑了,自 ...

  6. vscode c++不能使用bits/stdc++.h 解决方案

    有时新装的或更改配置后vscode无法使用bits/stdc++.h头文件,大多是因为include文件夹下没相关文件. 解决办法是,先写一段#include <vector>,然后ctl ...

  7. Visual Studio 中使用万能头文件 #include <bits/stdc++.h>

    Visual Studio 中使用万能头文件 #include 前言 最近开始使用VS,之前用的DEV C++软件可直接使用 #include <bits/stdc++.h> ,但VS中并 ...

  8. 使用万能头文件 #include<bits/stdc++.h>

    #include<bits/stdc++.h>介绍: 最近写编程题时发现了一个神奇的头文件,#include<bits/stdc++.h>,很多人在只要引用了这个头文件之后,就 ...

  9. MobileGestalt.h 头文件

    从 theos 目录下找到的 MobileGestalt.h 头文件,记录一下. * libMobileGestalt header.* Mobile gestalt functions as a Q ...

最新文章

  1. Confluence 6 查看空间活动
  2. C#_关于静态类和静态方法(转)
  3. 不懂卷积神经网络?别怕,看完这几张萌图你就明白了
  4. tomcat错误: javax.management.MalformedObjectNameException: Invalid character ':' in value part of prop
  5. [蓝桥杯2018决赛]三角形面积-数论
  6. 【定时同步系列1】定时同步之MARTIN OERDER算法原理与公式推导
  7. 一文学搞懂阿里开源的微服务新贵Nacos!
  8. python标准库学习笔记
  9. linux的网络管理,Linux下的网络管理工具—OpenNMS
  10. (转)一个用D3D绘制2D图形的例子
  11. 8.Linux的LVM使用详解
  12. Django入门4--admin
  13. Java 线程第三版 第八章 Thread与Collection Class 读书笔记
  14. 理解GetHashCode()的缺陷
  15. 春节假期,把“电影院”搬回家,泰捷WEBOX T1S 投影仪全面评测
  16. snipaste如何滚动截图_3款工具满足你对截图软件的所有想象
  17. EasyUI的基本使用布局
  18. 【Ubuntu系统下百度Apollo7.0与LGSVL2021.3联合教程(亲测有效)】
  19. k8s入门:存储(storage)
  20. form表单提交既有文字也有图片的情况下,增加enctype属性

热门文章

  1. vueuse(函数库)的基本使用,宝藏神器,务必收藏
  2. 流量战争:中国互联网的新一轮上山下乡运动
  3. LaTeX写作之中译英/英文语法纠正
  4. python解决警告InsecureRequestWarning: unverified HTTPS request is being made to host
  5. 流式DMA映射实践1:先写一个misc驱动框架
  6. dijkstra题目实战
  7. 未来纳米技术的计算机发展领域,纳米技术飞速发展 未来10年超级计算机只手掌大小...
  8. 处理器tdp测试软件,CPU-Z(cpu检测工具)
  9. Duang Duang Duang,CorelDRAW X7最新活动,这个你必须得加入!
  10. python中用什么函数去掉空格_Python中用于去除空格的三个函数的使用小结