2019独角兽企业重金招聘Python工程师标准>>>

codeforces已经有过说明。我这里只是把它翻译地更加浅显一点:

solution to include bits/stdc++.h in visual c++

By Tensor, 2 years ago, ,

  • This is just a method i used to make me able to include bits/stdc++.h
  • in visual c++.
  • for those had minGW installed on PC :
  • C:\MinGW\mingw32\lib\gcc\mingw32\4.8.1\include\c++\mingw32\bits
  • copy this folder and then go to this adress
  • C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include
  • paste your folder. go to your visual studio project type bits you will see
  • the auto-complete for the library and then choose stdc++.h
  • for those don't have minGW:
  • you should write your own header file and include all libraries in it then
  • go to C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include
  • make new folder name it "bits" and name the header file stdc++.h
  • then paste it in "bits" folder.
  • Hope this helps!
  • Happy coding

就是说

1.如果安装了MinGW的直接在文件夹里面找到bits这个文件夹(注意里面一定要包含stdc++.h,貌似我的版本有两个bits文件夹),把里面内容复制粘贴到vs的头文件库(一般是在c盘的安装目录)里面。

(2017.3.19修正,装VS2017时候找了好一会,已经不是在这个地方,应该是先找到VS主目录,然后往这里面找VS主要目录\VC\Tools\MSVC\14.10.25017\include)

2.如果没有安装MinGW,那么自己在vs的include文件夹里面新建一个bits文件夹,里面新建一个名叫stdc++.h的头文件,里面写你常用的头文件,这里我搬运一下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

转载于:https://my.oschina.net/feistel/blog/1795595

在VS中使用万能头文件#include bits/stdc++.h编译错误的解决方法相关推荐

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

    进行各种练习赛后,看题解代码时经常会看到这么一个陌生的头文件 #include <bits/stdc++.h> ,这个头文件是一个C++万能头文件,里面包含了程序比赛中所有可能用到的头文件 ...

  2. C++万能头文件#include“bits/stdc++.h”

    最近在打cf时赛后翻阅别人的代码总是会发现一个陌生而奇怪的头文件#include<bits/stdc++.h> 奇怪之处就在于基本上所有的代码只要用了这个头文件就不再写其他头文件了. 百度 ...

  3. VScode找不到C++万能头文件<bits/stdc++.h>解决办法

    VScode找不到C++万能头文件<bits/stdc++.h>解决办法 一.万能头文件介绍 万能头文件<bits/stdc++> 中包含了 C++中大部分头文件,在大部分做题 ...

  4. 【C++】万能头文件 <bits/stdc++.h> 的用法和优缺点

    [C++]万能头文件 bits/stdc++.h 的用法和优缺点 文章目录 [C++]万能头文件 bits/stdc++.h 的用法和优缺点 一.使用方法 二.头文件的内容 三.VS 中如何使用 四. ...

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

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

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

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

  7. 关于使用C++万能头文件时定义y1报编译错误的那点事

    事情是这样发生的,我在写一道网格求最短路径的题,在全局变量中定义了名为y1的变量,结果编译错误了. 肉眼排错五分钟后没有结果,于是我把代码删成这样: #include <bits/stdc++. ...

  8. 解决vscode头文件<bits/stdc++.h>报错问题

    问题背景 在使用VScode时发现万能头文件<bits/stdc++.h>的包含语句下出现红色波浪线,但是能正常运行. #include <bits/stdc++.h> 解决思 ...

  9. C++头文件<bits/stdc++.h>详解

    文章目录 前言 基本用法 内容 优点和缺点 优点 缺点 适用环境 前言 最近学了几节c++编程课,发现老师经常在代码第一行敲上一句: #include <bits/c++std.h> 后来 ...

最新文章

  1. Fast Terrain Rendering Using Geometrical MipMappin
  2. Linux下脚本实战之系统监控
  3. VTK:PolyData之InterpolateTerrain
  4. 牛客练习赛46 B 华华送奕奕小礼物 (预处理前缀和,二分)
  5. php 下拉菜单 搜索,DedeCMS实现百度搜索下拉菜单提示信息功能
  6. 建模分析师与算法工程师的主要区别
  7. 论文浅尝 | 面向跨语言实体对齐的知识图谱与实体描述协同嵌入方法
  8. 【AI视野·今日CV 计算机视觉论文速览 第213期】Fri, 4 Jun 2021
  9. 专栏推荐丨Oracle Database 21c 专栏
  10. Redis基础(九)——发布与订阅
  11. Linux安装winetim简单教程,[转载]wine安装最新版TIM
  12. Netch游戏加速器自建(糖豆人Free就是研究的动力)
  13. AI数学基础之:P、NP、NPC问题
  14. 在项目中怎样写故障树或者类层次
  15. 如何面对高水平的破解组织 谈暴力破解应对
  16. 对VC 一些常见问题的整理
  17. 如何关闭苹果手机自动扣费_iPhone自动扣费怎么取消?App Store、微信、支付宝关闭自动扣费教程...
  18. 速知!二级建造师你满足报考要求吗?
  19. 8.8 json和文件操作
  20. 损失函数 -交叉熵损失函数

热门文章

  1. 无耻之徒(美版)第七季/全集Shameless US迅雷下载
  2. pytorch搭建GhostNet网络模型
  3. 28335 CAN 接受邮箱中断配置,解决进不了中断函数的问题
  4. 基于PyTorch的人脸识别框架(翻译)
  5. 【听】自律力,关于如何提高自律能力的方法
  6. Maxproxy能否成为911S5的替代品?
  7. 剪切时文件丢失了怎么恢复?
  8. OpenSIPS处理200OK的ACK和RE-INVITE的时序问题
  9. 港科夜闻|香港科大学生获颁第一届香港-法国社区创新奖项
  10. php 静态 动态 cdn 加速,CDN静态加速跟动态加速的区别,动态加速好还是静态加速好?...