马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 zhangjinxuan 于 2022-12-20 13:19 编辑
创建一个文件,命名为 g.cpp
文件内容:#include "g.cpp"
#include "g.cpp"
#include "g.cpp"
#include "g.cpp"
#include "g.cpp"
#include "g.cpp"
#include "g.cpp"
#include "g.cpp"
#include "g.cpp"
#include "g.cpp"
#include "g.cpp"
#include "g.cpp"
#include "g.cpp"
#include "g.cpp"
#include "g.cpp"
#include "g.cpp"
#include "g.cpp"
#include "g.cpp"
#include "g.cpp"
#include "g.cpp"
#include "g.cpp"
#include "g.cpp"
#include "g.cpp"
#include "g.cpp"
#include "g.cpp"
#include "g.cpp"
#include "g.cpp"
#include "g.cpp"
#include "g.cpp"
#include "g.cpp"
#include "g.cpp"
#include "g.cpp"
#include "g.cpp"
#include "g.cpp"
#include "g.cpp"
int main() {
}
这个 #include "g.cpp" 你爱填多少就填多少,填的越多你的编译器越快乐~
最终,你可能会得到长约15000行的离谱报错(windows dev-cpp g++):1 g.cpp In file included from g.cpp
1 g.cpp from g.cpp
1 g.cpp from g.cpp
1 g.cpp from g.cpp
1 g.cpp from g.cpp
1 g.cpp from g.cpp
1 g.cpp from g.cpp
1 g.cpp from g.cpp
1 g.cpp from g.cpp
1 g.cpp from g.cpp
1 g.cpp from g.cpp
1 g.cpp from g.cpp
1 g.cpp from g.cpp
1 17 g.cpp [Error] #include nested too deeply
2 17 g.cpp [Error] #include nested too deeply
3 17 g.cpp [Error] #include nested too deeply
4 17 g.cpp [Error] #include nested too deeply
5 17 g.cpp [Error] #include nested too deeply
6 17 g.cpp [Error] #include nested too deeply
7 17 g.cpp [Error] #include nested too deeply
8 17 g.cpp [Error] #include nested too deeply
9 17 g.cpp [Error] #include nested too deeply
10 17 g.cpp [Error] #include nested too deeply
11 17 g.cpp [Error] #include nested too deeply
12 17 g.cpp [Error] #include nested too deeply
13 17 g.cpp [Error] #include nested too deeply
14 17 g.cpp [Error] #include nested too deeply
15 17 g.cpp [Error] #include nested too deeply
16 17 g.cpp [Error] #include nested too deeply
17 17 g.cpp [Error] #include nested too deeply
18 17 g.cpp [Error] #include nested too deeply
19 17 g.cpp [Error] #include nested too deeply
20 17 g.cpp [Error] #include nested too deeply
21 17 g.cpp [Error] #include nested too deeply
22 17 g.cpp [Error] #include nested too deeply
23 17 g.cpp [Error] #include nested too deeply
24 17 g.cpp [Error] #include nested too deeply
25 17 g.cpp [Error] #include nested too deeply
26 17 g.cpp [Error] #include nested too deeply
27 17 g.cpp [Error] #include nested too deeply
28 17 g.cpp [Error] #include nested too deeply
29 17 g.cpp [Error] #include nested too deeply
30 17 g.cpp [Error] #include nested too deeply
31 17 g.cpp [Error] #include nested too deeply
32 17 g.cpp [Error] #include nested too deeply
33 17 g.cpp [Error] #include nested too deeply
34 17 g.cpp [Error] #include nested too deeply
35 17 g.cpp [Error] #include nested too deeply
22 g.cpp In file included from g.cpp
【此处省略约15000行……】
完整报错
这是一个长的离谱的编译报错!.zip
(3.27 KB, 下载次数: 6)
不难发现,这个和小甲鱼老师说的“递归结构体”有相似之处,属是你中有我,我中有你,就无限递归啦~
大家在之后搞工程或者做什么的也要注意,不要出现 include 本身的情况,免得这么多报错把软件卡死了 (编译完后我的软件真崩溃了)
此外呢,大家还能想出更离谱的编译报错吗
附:鱼油投稿( tommyyu ):
#include <stdlib.h>
int main()
{
while(1) system("start g.exe");
}
把这个保存为g.cpp,编译出g.exe,然后运行,然后电脑就会特别快乐
这个就不要轻易尝试了 |