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

 更新时间:2020年02月06日 13:51:07   作者:橘嘉禾  
这篇文章主要介绍了手动添加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的详细步骤,希望对大家有所帮助!

相关文章

  • C++从文件中提取英文单词的实现方法

    C++从文件中提取英文单词的实现方法

    本文主要介绍了C++从文件中提取英文单词的实现方法,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
    2022-06-06
  • C++实现通讯录管理系统项目

    C++实现通讯录管理系统项目

    这篇文章主要为大家详细介绍了C++实现通讯录管理系统项目,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
    2022-06-06
  • c语言中return与exit的区别浅析

    c语言中return与exit的区别浅析

    c语言中return与exit的区别浅析,需要的朋友可以参考一下
    2013-03-03
  • C/C++仿华容道小游戏

    C/C++仿华容道小游戏

    这篇文章主要介绍了C/C++仿华容道小游戏的相关资料,模仿实现华容道游戏,感兴趣的朋友可以参考一下
    2016-02-02
  • C++中声明类的class与声明结构体的struct关键字详解

    C++中声明类的class与声明结构体的struct关键字详解

    这篇文章主要介绍了C++中声明类的class与声明结构体的struct关键字,默认情况下结构的所有成员均是公有的,而类的所有成员是私有的,需要的朋友可以参考下
    2016-01-01
  • C++发送邮件实现代码

    C++发送邮件实现代码

    这篇文章主要为大家详细介绍了C++发送邮件的实现代码,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
    2018-05-05
  • 从string类的实现看C++类的四大函数(面试常见)

    从string类的实现看C++类的四大函数(面试常见)

    C++类一般包括构造函数、拷贝构造函数、析构函数和赋值函数四大函数,非常常见,本文给大家介绍从string类的实现看C++类的四大函数,一起看看吧
    2016-06-06
  • C语言中如何利用循环嵌套输出一个菱形

    C语言中如何利用循环嵌套输出一个菱形

    这篇文章主要介绍了C语言中如何利用循环嵌套输出一个菱形问题,具有很好的参考价值,希望对大家有所帮助。如有错误或未考虑完全的地方,望不吝赐教
    2023-02-02
  • 在Ubuntu中安装VSCode并配置C/C++开发环境的方法步骤

    在Ubuntu中安装VSCode并配置C/C++开发环境的方法步骤

    这篇文章主要介绍了在Ubuntu中安装VSCode并配置C/C++开发环境的方法步骤,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
    2020-05-05
  • C++选择文件夹代码的封装

    C++选择文件夹代码的封装

    这篇文章主要介绍了C++选择文件夹代码的封装,实例展示了将选择文件夹功能代码封装为一个类并对其进行实例化调用的过程,对于学习C++程序设计有不错的参考价值,需要的朋友可以参考下
    2014-10-10

最新评论