VScode⽆法使⽤C++万能头⽂件#includebitsstdc++.h解决⽅
案
在刷题的时候,使⽤万能头⽂件 #include<bits/stdc++.h>,但是vscode⽆法识别,不到头⽂件。
问题出在路径中没有这个⽂件,所以创建这个⽂件。
红波浪线报错
解决⽅案,亲测有效
1. 在代码的头⽂件加⼊#include<iostream>,右键转到定义
屏幕快照 2020-09-14 11.56.46.png
2. 在打开的iostream⽂件上右键“在finder中显⽰”,到该⽂件所在的⽂件夹(win系统同理)
屏幕快照 2020-09-14 12.20.23.png
3. 在该⽂件夹下,新建⼀个txt⽂件,将名称改为stdc++.h,粘贴下⾯这段内容到⾥⾯,并将⽂件保存在此。
屏幕快照 2020-09-14 12.21.44.png
// C++ includes used for precompiling -*- C++ -*-
// Copyright (C) 2003-2014 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 un // 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 P // 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 Softwa // You should have received a copy of the GNU General Public License a
nd// a copy of the GCC Runtime Library Exception along with this program;// see the files COPYING3 /** @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>
system的头文件#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>
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论