一、去掉预编译头

使用VS2017的时候,发现总是会有“pch.h”,“stdafx.h”这类预编译头,去掉还会报错。作为新手的我,暂时用不到这些预编译头,于是想去掉它们。

右键项目->属性->C/C++->预编译头,如下图所示,然后选择不使用预编译头即可。

二、设置C++标准

用VS2017写C++的时候想设置一下C++标准,设置成C++14或C++17。

右键项目->属性->C/C++->语言,如下图所示,在C++语言标准选择想要的C++版本即可。

三、使用<bits/stdc++.h>头文件

因为直前用别的编译器都习惯用#include<bits/stdc++.h>都懒得打头文件了。然后,发现VS2017使用这个头文件会报错提示找不到,于是上网找了一下办法。

既然VS2017没有,我们就自己加上去,找到VS2017安装目录,然后找到include文件,我的文件路径是这个:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include

然后自己创一个bits文件夹,然后进入bits文件夹,创建stdc++.h文件,添加下面的内容:

// 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

添加完成之后,我们就能正常地使用#include<bits/stdc++.h>了。

使用VS2017遇到的一些小问题的更多相关文章

  1. 【VS工具】vs2017中的一些小功能

    一.json转为类 1.打开一个json文件,复制 2.打开一个.cs文件,将json粘贴为类 3.got it 二.C#交互窗口 1.视图->其他窗口->C#交互窗口  2.打开了一个窗 ...

  2. VS2017 - Winform 简单托盘小程序

    界面比较简单,主要两个button 一个NotifyIcon 和 右键菜单 控件, NotifyIcon 属性,如下: 并为NotifyIcon指定了DoubleClick事件: 主窗体增加两个事件: ...

  3. Asp.NetCore1.1版本没了project.json,这样来生成跨平台包

    本章将要和大家分享的是Asp.NetCore1.1版本去掉了project.json后如何打包生成跨平台包, 为了更好跟进AspNetCore的发展,把之前用来做netcore开发的vs2015卸载后 ...

  4. Visual studio 编辑combobox程序卡死的问题

    问题描述:使用vs2017开发一个winform小程序,一用combobox就卡死. 问题解决:关闭有道词典的取词功能. 软件开多了,就容易有冲突啊!

  5. 【asp.net core】Publish to a Linux-Ubuntu 14.04 Server Production Environment

    Submary 又升级了,目录结构有变化了 . project.json and Visual Studio 2015 with .NET Core On March 7, 2017, the .NE ...

  6. Vs2017 typescript 开发小问题

    最近想写点ts的东西,以前用vs2015很方便,直接创建一个ts app项目就折腾了. Vs2017打开,居然发现这个项目模板不见了.   于是研究了一下,由于原来的ts app项目就是一个asp.n ...

  7. windows10 vs2017编译opencv_contrib3.4.7的小坑及编译好的资源

    1.注意要用正斜杠  /    不要用 \  https://github.com/opencv/opencv/issues/11655 CMake Error at cmake/OpenCVModu ...

  8. vs2017 .net core WebApp 去掉ApplicationInsights

    vs2017新建的 .net core WebApp都内置了这个遥测中间件进去,嗯,用AZURE的话是不错能无缝支持.但不用AZURE就没什么用了. 为了不占地方和提高一点点初始启动的速度,对新建的项 ...

  9. [干货来袭]C#7.0新特性(VS2017可用)

    前言 微软昨天发布了新的VS 2017 ..随之而来的还有很多很多东西... .NET新版本 ASP.NET新版本...等等..太多..实在没消化.. 分享一下其实2016年12月就已经公布了的C#7 ...

随机推荐

  1. C#中精确计时的一点收获 Stopwatch

    http://www.cnblogs.com/jintianhu/archive/2010/09/01/1815031.html 参考: https://www.cnblogs.com/kissdod ...

  2. DataTable求列的最大值、最小值、平均值和样本数

    与sql聚合函数相似,会屏蔽null table.Compute("max(ColumnName)", "true"); table.Compute(" ...

  3. VS2019+EF6连接Mysql

    开发环境:Win10 + VS2019Mysql服务器版本:8.0.16 一.下载并安装插件(必备) MySQL-Connector-net-6.9.12  链接https://cdn.mysql.c ...

  4. C#使用表达式树动态调用方法并实现99乘法表

    我们在使用C#编程的时候,经常使用反射来动态调用方法,但有时候需要动态的生成方法,下面介绍使用表达式树的方式来自动生成方法,并调用. 首先需要说明什么是表达式,熟悉Linq的程序猿都用过类似于下面的代 ...

  5. vuex简单化理解和安装使用

     1.简单化理解 首先你要明白 vuex 的目的 就是为了 集中化的管理项目中 组件所有的 数据状态 (state) 0. 第一步你要明白 , store 的重要性 , store 类似一个中央基站, ...

  6. 【转载】如何删除Windows远程桌面保存的账号密码数据

    在Windows系统中,无论是win7.win8还是win10系统,都可使用Windows系统自带的远程桌面连接工具来远程服务器,很多时候Windows远程桌面在连接一次后会自动保存连接的账号密码等信 ...

  7. PHP extension_loaded()用法

    一.extension_loaded()函数表示检查一个扩展是否成功加载 if(!extension_loaded('sysvmsg')) { echo "Please install sy ...

  8. HTML 初始

    HTML(Hyper Text Markup Language的缩写)中文译为“超文本标记语言”,主要是通过HTML标签对网页中的文本.图片.声音等内容进行描述. 一.HTML 骨架结构 每种语言都有 ...

  9. JAVA - Eclipse不能打断点的解决方法

    今天调试eclipse程序,莫名的就遇到这种问题. 解决: 在run菜单里面,把 “skip all breakpoints”  选项勾去即可. 如下图:

  10. Unity手游汉化笔记②:使用UABE替换TTF字体

    总的笔记:https://www.cnblogs.com/guobaoxu/p/12055930.html 目录 一.分析 二.思路 三.具体实践 四.总结 Unity版本:2018.4.5f1 工具 ...