Visual Studio 2022中創(chuàng)建的C++項(xiàng)目無法使用萬能頭<bits/stdc++.h>的解決方案
發(fā)現(xiàn)問題
如果大家也遇到下面這種問題,可能是沒有include文件夾中沒有bits/stdc++.h
解決辦法
第一步
打開一個(gè)C++項(xiàng)目,鼠標(biāo)移動(dòng)至頭文件上右擊,選擇轉(zhuǎn)到文檔或者把鼠標(biāo)光標(biāo)對(duì)準(zhǔn)頭文件那一行直接按鍵盤上的F12
第二步
跳轉(zhuǎn)至文檔后,把鼠標(biāo)移動(dòng)至頭文件處,右擊鼠標(biāo),選擇打開所在文件夾
第三步
這時(shí)用管理員權(quán)限創(chuàng)建一個(gè)名為bits的文件夾,如果管理員權(quán)限只能創(chuàng)建文件夾,則選擇到桌面進(jìn)行下一步的stdc++.h文件的創(chuàng)建
第四步
將以下內(nèi)容寫入stdc++.h中保存后,再將桌面上的stdc++.h文件拖入bits文件夾中
#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
最后一步
重啟Visual Studio 2022,此時(shí)就可以正常使用#include<bits/stdc++.h>了
可以發(fā)現(xiàn)編譯器的報(bào)錯(cuò)和#include的紅色波浪線沒有了,證明我們成功了!
問題解決
此時(shí)用#include<bits/stdc++.h>,無需其他頭文件代碼也可以正常編譯運(yùn)行
到此這篇關(guān)于Visual Studio 2022中創(chuàng)建的C++項(xiàng)目無法使用萬能頭<bits/stdc++.h>解決方案的文章就介紹到這了,更多相關(guān)Visual Studio 2022無法使用萬能頭<bits/stdc++.h>內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
C++實(shí)現(xiàn)LeetCode(151.翻轉(zhuǎn)字符串中的單詞)
這篇文章主要介紹了C++實(shí)現(xiàn)LeetCode(151.翻轉(zhuǎn)字符串中的單詞),本篇文章通過簡(jiǎn)要的案例,講解了該項(xiàng)技術(shù)的了解與使用,以下就是詳細(xì)內(nèi)容,需要的朋友可以參考下2021-07-07淺析成員函數(shù)和常成員函數(shù)的調(diào)用
下面小編就為大家?guī)硪黄獪\析成員函數(shù)和常成員函數(shù)的調(diào)用。小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考,一起跟隨小編過來看看吧2016-05-05C語言實(shí)現(xiàn)靜態(tài)版通訊錄的示例代碼
這篇文章主要為大家詳細(xì)介紹了如何利用C語言實(shí)現(xiàn)一個(gè)簡(jiǎn)單的靜態(tài)版通訊錄,文中的示例代碼講解詳細(xì),對(duì)我們學(xué)習(xí)C語言有一定幫助,需要的可以參考一下2022-08-08vs2019 MFC實(shí)現(xiàn)office界面的畫圖小項(xiàng)目
本文主要介紹了vs2019 MFC實(shí)現(xiàn)office界面的畫圖小項(xiàng)目,對(duì)大家入門有一定的幫助,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2021-06-06Win32下C++實(shí)現(xiàn)快速獲取硬盤分區(qū)信息
這篇文章主要為大家詳細(xì)介紹了Win32下C++如何實(shí)現(xiàn)快速獲取硬盤分區(qū)信息,文中的示例代碼講解詳細(xì),感興趣的小伙伴可以跟隨小編一起學(xué)習(xí)一下2025-03-03Visual?Studio?2022下載安裝與使用超詳細(xì)教程
這篇文章主要介紹了Visual?Studio?2022最新版安裝與使用教程,本文以社區(qū)版為例通過圖文并茂的形式給大家介紹Visual?Studio?2022安裝使用,需要的朋友可以參考下2022-04-04C++類重載函數(shù)的function和bind使用示例
這篇文章主要介紹了C++類重載函數(shù)的function和bind使用示例,幫助大家更好的理解和使用c++,感興趣的朋友可以了解下2021-01-01