当前位置: 首页 > news >正文

如何在MAC OS中的XCODE下添加 <bits/stdc++.h>

        mac上使用的编译器是Clang,但是没有万能头文件bits/stdc++.h\,本文介绍如何添加万能头文件

        Xcode 版本:15.1

 - 打开应用程序-Xcode-右键显示包内容

Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include

        低版本: 

Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 

 - 在该文件夹下创建文件名为 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 

导入或新建成功之后,即可使用

http://www.lryc.cn/news/269638.html

相关文章:

  • Maven项目提示Ignored pom.xml问题
  • SQL学习汇总
  • 单片机MCU堆栈概念与区别
  • C#中使用is关键字检查对象是否与给定类型兼容
  • AI时代下,如何看待“算法利维坦”?
  • Linux上管理不同版本的 JDK
  • 直方图与均衡化
  • Java——猫猫图鉴微信小程序(前后端分离版)
  • PiflowX组件-ReadFromKafka
  • Ubuntu 安装MySQL以及基本使用
  • 基于Freeswitch实现的Volte网视频通知应用
  • 怎么实现Servlet的自动加载
  • 15. Mysql 变量的使用
  • 为什么ChatGPT采用SSE协议而不是Websocket?
  • Elasticsearch:使用 ELSER v2 文本扩展进行语义搜索
  • Matlab:BP神经网络算法,二叉决策树
  • Python实现员工管理系统(Django页面版 ) 七
  • 听GPT 讲Rust源代码--src/tools(34)
  • k8s的陈述式资源管理(命令行操作)
  • uniapp uview裁剪组件源码修改(u-avatar-cropper),裁出可自定义固定大小图片
  • 【机器学习前置知识】Beta分布
  • Notepad++批量更改文件编码格式及文档格式
  • Linux驱动开发学习笔记6《蜂鸣器实验》
  • 鸿蒙(HarmonyOS 3.1) DevEco Studio 3.1开发环境汉化
  • 毫米波雷达:从 3D 走向 4D
  • CENTOS docker拉取私服镜像
  • 【前端面经】即时设计
  • 前端三件套html/css/js的基本认识以及示例程序
  • 云计算:OpenStack 配置云主机实例的存储挂载并实现外网互通
  • python/selenium/jenkins整合