手动添加bits/stdc++.h到vs2017的详细步骤

本机环境:win10系统 64位 vs2017

最近码代码时偶然发现了bits/stdc++.h这个头文件(万能头文件),基本上所有的代码只要用了这个头文件就不再写其他头文件了。

看到它就仿佛开启了新世界(也有缺点,就是导致编译速度变慢,不过一般可以忽略不计)。

【如果安装了MinGW的直接在文件夹里面找到bits这个文件夹,把里面内容复制粘贴到vs的头文件库里面】

1 .新建txt文档,把以下代码(stdc++.h源码)复制进去:

// C++ includes used for precompiling -*- C++ -*-

// Copyright (C) 2003-2015 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

2. 把txt文档改名stdc++.h

3. 打开vs2017的安装目录

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include
格式类似上面

在“include”目录下新建文件夹“bits”,然后把刚才的bits/stdc++.h移入。

4.  大功告成

总结

以上所述是小编给大家介绍的手动添加bits/stdc++.h到vs2017的详细步骤,希望对大家有所帮助!

(0)

相关推荐

  • 详解C++ bitset用法

    C++的 bitset 在 bitset 头文件中,它是一种类似数组的结构,它的每一个元素只能是0或1,每个元素仅用1bit空间. 下面是具体用法 构造函数 bitset常用构造函数有四种,如下 bitset<4> bitset1; //无参构造,长度为4,默认每一位为0 bitset<8> bitset2(12); //长度为8,二进制保存,前面用0补充 string s = "100101"; bitset<10> bitset3(s); //长

  • 使用bitset实现毫秒级查询(实例讲解)

    前言 因为业务要求api的一次请求响应时间在10ms以内,所以传统的数据库查询操作直接被排除(网络io和磁盘io).通过调研,最终使用了bieset,目前已经正常运行了很久 bitset介绍 看JDK中的解释简直一头雾水,用我自己的理解概括一下 1.bitset的内部实现是long数组 2.set中每一个位的默认值为false(0) 3.bitset长度按需增长 4.bitset非线程安全 bitset关键方法分析 /** * Sets the bit at the specified inde

  • 手动添加bits/stdc++.h到vs2017的详细步骤

    本机环境:win10系统 64位 vs2017 最近码代码时偶然发现了bits/stdc++.h这个头文件(万能头文件),基本上所有的代码只要用了这个头文件就不再写其他头文件了. 看到它就仿佛开启了新世界(也有缺点,就是导致编译速度变慢,不过一般可以忽略不计). [如果安装了MinGW的直接在文件夹里面找到bits这个文件夹,把里面内容复制粘贴到vs的头文件库里面] 1 .新建txt文档,把以下代码(stdc++.h源码)复制进去: // C++ includes used for precom

  • 关于VS2022不能使用<bits/stdc++.h>的解决方案(万能头文件)

    •<bits/stdc++.h>介绍 #include<bits/stdc++.h>包含了目前 C++ 所包含的所有头文件,又称万能头文件,简直是开挂一般的存在. 你编程所需要的头文件基本上都囊括在了该万能头文件中,试想一下,将若干行头文件: #include<iostream> #include<cstdio> #include<string> #include<map> #include<vector> ......

  • jar包手动添加到本地maven仓库的步骤详解

    目录 第一步:下载需要添加的jar包 第二步:将下载的jar包放到指定位置(位置自己指定,用得到) 第三步:配置本地maven库 总结 第一步:下载需要添加的jar包 可以在maven库中查找下载,也可以在对应官网下载 maven库网址:https://mvnrepository.com/ 第二步:将下载的jar包放到指定位置(位置自己指定,用得到) 建议放在maven的repository路径下,方便管理 第三步:配置本地maven库 1.首先检查本地maven库环境变量是否配置正确 打开cm

  • 将下载到本地的JAR包手动添加到Maven仓库的方法

    <!-- https://mvnrepository.com/artifact/ojdbc/ojdbc --> <!-- (参数一):下载到本地的ojdbc-10.2.0.4.0.jar包的真实存放路径 --> <dependency> <groupId>ojdbc</groupId>-----------------(参数二) <artifactId>ojdbc</artifactId>-----------(参数三)

  • IntelliJ IDEA Java项目手动添加依赖 jar 包的方法(图解)

    1. 事先下载完成需要的javacsv.jar包.  java项目在没有导入该jar包之前,显示如下图所示 2. 点击 File -> Project Structure(快捷键 Ctrl + Alt + Shift + s),点击Project Structure界面左侧的"Modules"显示下图界面 3. 在 "Dependencies" 标签界面下,点击右边绿色的 "+"号,选择第一个选项"JARs or director

  • 微信小程序手动添加收货地址省市区联动

    本文实例为大家分享了微信小程序手动添加收货地址省市区联动的具体代码,供大家参考,具体内容如下 先看效果图 html部分 用小程序的piceker-view 嵌入页面的滚动选择器 <picker-view indicator-style="height: 50px;" style="width:100%; height: 400rpx;" bindchange="bindChange"> <picker-view-column c

  • 手动添加jar包进Maven本地库内的方法

    正常maven依赖jar包的pom.xml写法如下: <!-- https://mvnrepository.com/artifact/ojdbc/ojdbc --> <!-- (参数一):下载到本地的ojdbc-10.2.0.4.0.jar包的真实存放路径 --> <dependency> <groupId>ojdbc</groupId>-----------------(参数二) <artifactId>ojdbc</arti

  • IDEA手动添加junit4时出现的问题与解决方法

    当我写@Test注解时,一直报错 后来百度是缺少junit4的包 手动添加junit4包 具体查看是在左上角 file–>project structure 点击进来以后选择modules,再点击当前的项目JDBC,就可以看到当前模块的一些依赖库,此时是没有导入junit4的. 此时点击右边加号,点击2.library,再点击Java,选择IDEA安装目录,在lib文件夹中找到junit-4.12 然后应用,此时@Test注解不再报错,但是运行时出现错误 查询官网: 查官网: JUnit now

  • iOS手动添加新字体的步骤和踩坑记录

    目录 前言 字体添加 1.引入字体文件 2.配置 Info.plist 文件 3.解决添加新字体不生效问题 4.代码中设置字体 总结 前言 最近在一个日记软件,发现系统的默认字体过于丑陋,于是有了更改应用字体的想法.完成操作的过程中踩了一些小坑,写下此文记录一下,希望能对后人有所帮助. 字体添加 1.引入字体文件 直接将下载好的字体文件拖入项目中 2.配置 Info.plist 文件 在 Info.plist 文件中添加新行 "Fonts provided by application"

  • el-form错误提示信息手动添加和取消的示例代码

    目录 需求 方案 最新想到的方案 推荐 运行效果: 实现代码 需求 对表单填写字段进行标记有误和取消标记有误 方案 最新想到的方案 推荐 定义一个存放错误信息的对象,然后再自定义一个验证规则,在这个验证规则中,通过当前验证字段的prop值,到存放错误信息的对象中获取对应的错误提示文案,如果获取到了,则说明,该字段存在标记有误,则让验证不通过,反之,则让验证通过 运行效果: 实现代码 <template> <div> <h1>标记有误/取消标记有误:</h1>

随机推荐