Remove the precompiled header
H, stdafx.h, stdafx.h, stdafx.h, stdafx.h, stdafx.h, stdafx.h, stdafx.h, stdafx.h, stdafx.h As a newbie, I didn’t need these precompiled headers for a while, so I wanted to get rid of them.
Right-click item ->; Property – & gt; C/C++-> Precompiled headers, as shown below, and then select not to use precompiled headers.
Set the C++ standard
When writing C++ in VS2017, you want to set the C++ standard. Set it to C++14 or C++17.
Right-click item ->; Property – & gt; C/C++-> Language, as shown in the figure below, in the C++ language standard to select the desired C++ version.
3. Use lt; bits/stdc++.h> The header file
#include< #include< bits/stdc++.h> I’m too lazy to start a file. Then, found that VS2017 using this header file will report error prompts can not be found, so the Internet to find a way.
Since VS2017 is not available, we will add it ourselves, find the VS2017 installation directory, and then find the include file, my file path is this:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ Include
Then create your own bits folder, then go to the bits folder, create the file stdc++. H, and add the following:
// 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
Once the addition is complete, we will be able to use the #include< as normal. bits/stdc++.h> .
Reproduced in: https://www.cnblogs.com/fu3638/p/10801251.html
Read More:
- Small problems encountered in compiling OpenGL under VS2010
- |-OpenGL – | some small problems about the glut Library
- Some problems and solutions in learning opengl in vs2017
- A series of problems in configuring OpenGL development environment in vs2015
- There are many problems in the use of vs2017
- Common compatibility problems of VS2010 to vs2017 projects
- Problems in using vs2017
- Some configuration problems of OpenGL in VS2008
- Some common problems in the use of vs2017
- Solutions to some problems encountered in programming with vs2017
- Problems encountered in VS2010 compilation
- Problems encountered in configuring OpenGL development environment in vs2015
- Write about the problems and solutions when configuring OpenGL in vs2015
- Summary of problems encountered in compiling and installing vtk7 + vs2013 / 2015 + cmake
- Problems encountered in vs2015 configuration using OpenGL environment
- Record of problems encountered in using vs2017
- Problems caused by vs project build order: link: fatal error lnk1181: cannot open input file ‘zoom’_ Ui_ style.lib ‘
- Configuring OpenGL in Chinese version of VS2010 and problem solving
- OpenGL environment configuration under VS2010 / vs2012 / vs2015
- Summary of problems encountered in using OpenGL in QT