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

ubuntu添加万能头文件

ubuntu的C++头文件目录为/usr/include

  1. 在/usr/include下新建文件夹 bits
sudo mkdir bits
  1. 进入bits,新建stdc++.h,并修改权限为744/777
cd bits;sudo touch stdc++.h;sudo chmod 777 stdc++.h
  1. 将以下内容粘贴到stdc++.h,保存退出
// C++ includes used for precompiling -*- C++ -*-// Copyright (C) 2003-2013 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
// <Licenses - GNU Project - Free Software Foundation>./** @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

之后就可在cpp文件中调用万能头文件了

#include <bits/stdc++.h>
using namespace std;
int main() {cout<<"hello"<<endl;//在此处写代码
}
http://www.lryc.cn/news/111582.html

相关文章:

  • 聊一聊关于前端语法 ?? 的那些事
  • 宝塔Linux面板升级“获取更新包失败”怎么解决?
  • 训练强化学习的经验回放策略:experience replay
  • uniapp学习
  • 机器学习深度学习——数值稳定性和模型化参数(详细数学推导)
  • layui 整合UEditor 百度编辑器
  • 1、sparkStreaming概述
  • 【Spring Boot】Spring Boot 集成 RocketMQ 实现简单的消息发送和消费
  • uniapp:图片验证码检验问题处理
  • 将Visio和Excel导出成没有白边的PDF文件
  • String类及其工具类
  • 踩坑(5)整合kafka 报错 java.net.UnknownHostException: 不知道这样的主机
  • rust持续学习 get_or_insert_with
  • 卡尔曼滤波 | Matlab实现无迹kalman滤波仿真
  • C++---list常用接口和模拟实现
  • [openCV]基于赛道追踪的智能车巡线方案V1
  • SpringIoc-个人学习笔记
  • 【一文搞懂泛型】
  • 概念解析 | 利用MIMO雷达技术实现高性能目标检测的关键技术解析
  • Grafana制作图表-自定义Flink监控图表
  • 【TypeScript】初识TypeScript和变量类型介绍
  • 阿里云瑶池 PolarDB 开源官网焕新升级上线
  • 泡水书为什么不能再出售
  • Mac 执行 .sh命令报错 command not found
  • postgresql 使用之 存储架构 触摸真实数据的存储结构以及组织形式,存入数据库的数据原来在这里
  • Node.Js安装与配置教程
  • Element-Plus DatePicker获取时间戳
  • 【算法第十五天7.29】513.找树左下角的值 112. 路径总和 106.从中序与后序遍历序列构造二叉树
  • Java thymeleaf bug排查记录
  • 互感和励磁电感(激磁电感)的关系