gpt4 book ai didi

c++ - 如何找到 "real"错误?

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:29:52 25 4
gpt4 key购买 nike

我在程序的错误列表中出现了大量错误,但列出的似乎都不是“真正的”错误。有些线是红色的,然后当我突出显示它们时,错误消失了。我似乎无法找到我的错误到底在哪里。找出我的错误的最佳流程是什么?

以下是错误列表,以备不时之需。

    Error   38  error C1004: unexpected end-of-file found   85
Error 68 error C1004: unexpected end-of-file found 42
Error 63 error C1903: unable to recover from previous error(s); stopping compilation 72
Error 66 error C2059: syntax error : ')' 42
Error 2 error C2059: syntax error : '>' 80
Error 40 error C2059: syntax error : '>' 80
Error 65 error C2059: syntax error : '>' 42
Error 20 error C2065: '_Ptr_cerr' : undeclared identifier 27
Error 16 error C2065: '_Ptr_cin' : undeclared identifier 25
Error 22 error C2065: '_Ptr_clog' : undeclared identifier 28
Error 18 error C2065: '_Ptr_cout' : undeclared identifier 26
Error 28 error C2065: '_Ptr_wcerr' : undeclared identifier 32
Error 24 error C2065: '_Ptr_wcin' : undeclared identifier 30
Error 30 error C2065: '_Ptr_wclog' : undeclared identifier 33
Error 26 error C2065: '_Ptr_wcout' : undeclared identifier 31
Error 4 error C2065: 'faction' : undeclared identifier 84
Error 42 error C2065: 'faction' : undeclared identifier 84
Error 64 error C2065: 'Faction' : undeclared identifier 42
Error 13 error C2065: 'socialite' : undeclared identifier 100
Error 51 error C2065: 'socialite' : undeclared identifier 100
Error 1 error C2065: 'Socialite' : undeclared identifier 80
Error 12 error C2065: 'Socialite' : undeclared identifier 100
Error 39 error C2065: 'Socialite' : undeclared identifier 80
Error 50 error C2065: 'Socialite' : undeclared identifier 100
Error 8 error C2065: 'textWriter' : undeclared identifier 82
Error 46 error C2065: 'textWriter' : undeclared identifier 82
Error 6 error C2143: syntax error : missing ',' before ')' 84
Error 10 error C2143: syntax error : missing ',' before ')' 82
Error 14 error C2143: syntax error : missing ',' before ')' 100
Error 44 error C2143: syntax error : missing ',' before ')' 84
Error 48 error C2143: syntax error : missing ',' before ')' 82
Error 52 error C2143: syntax error : missing ',' before ')' 100
Error 17 error C2143: syntax error : missing ',' before ';' 25
Error 19 error C2143: syntax error : missing ',' before ';' 26
Error 21 error C2143: syntax error : missing ',' before ';' 27
Error 23 error C2143: syntax error : missing ',' before ';' 28
Error 25 error C2143: syntax error : missing ',' before ';' 30
Error 27 error C2143: syntax error : missing ',' before ';' 31
Error 29 error C2143: syntax error : missing ',' before ';' 32
Error 31 error C2143: syntax error : missing ',' before ';' 33
Error 7 error C2143: syntax error : missing ';' before '{' 32
Error 15 error C2143: syntax error : missing ';' before '{' 10
Error 32 error C2143: syntax error : missing ';' before '{' 36
Error 35 error C2143: syntax error : missing ';' before '{' 27
Error 45 error C2143: syntax error : missing ';' before '{' 32
Error 54 error C2143: syntax error : missing ';' before '{' 34
Error 57 error C2143: syntax error : missing ';' before '{' 48
Error 60 error C2143: syntax error : missing ';' before '{' 61
Error 3 error C2143: syntax error : missing ';' before '}' 82
Error 11 error C2143: syntax error : missing ';' before '}' 98
Error 33 error C2143: syntax error : missing ';' before '}' 42
Error 34 error C2143: syntax error : missing ';' before '}' 45
Error 36 error C2143: syntax error : missing ';' before '}' 83
Error 37 error C2143: syntax error : missing ';' before '}' 85
Error 41 error C2143: syntax error : missing ';' before '}' 82
Error 49 error C2143: syntax error : missing ';' before '}' 98
Error 55 error C2143: syntax error : missing ';' before '}' 43
Error 58 error C2143: syntax error : missing ';' before '}' 57
Error 61 error C2143: syntax error : missing ';' before '}' 69
Error 67 error C2143: syntax error : missing ';' before '}' 42
Error 5 error C2275: 'Faction' : illegal use of this type as an expression 84
Error 43 error C2275: 'Faction' : illegal use of this type as an expression 84
Error 9 error C2275: 'std::ofstream' : illegal use of this type as an expression 82
Error 47 error C2275: 'std::ofstream' : illegal use of this type as an expression 82
Error 53 error C2653: 'Socialite' : is not a class or namespace name 33
Error 56 error C2653: 'Socialite' : is not a class or namespace name 46
Error 59 error C2653: 'Socialite' : is not a class or namespace name 60
Error 62 error C2653: 'Socialite' : is not a class or namespace name 72

最佳答案

可能是遗漏了;在一个类/结构的结束}之后。你能发布一些代码吗?

更新:代码现在可以在我的 gcc 上编译。我发现的问题是你的类之间存在循环依赖。所以解决这个问题,在标题中转发声明其中的一些。我在 Socialite.hclass Socialite; 之前添加了 class Faction; class Socialite 之前 class Faction Faction.h 中。

关于c++ - 如何找到 "real"错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16928012/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com