msdn 里关于error C1004的描述如 929 说的.
我想最大的可能还是类和结构定义的右括号"}"后少了“;”
着重检查头文件.若有问题的头文件在多处被包含了,可能多处出错.
而 msdn 里关于 error C1004 的描述 还有使用了特殊编译伪指令的情况,请查msdn
我想最大的可能还是类和结构定义的右括号"}"后少了“;”
着重检查头文件.若有问题的头文件在多处被包含了,可能多处出错.
而 msdn 里关于 error C1004 的描述 还有使用了特殊编译伪指令的情况,请查msdn
Fatal Error C1004
unexpected end of file found
The compiler reached the end of a source file without resolving a construct.
For instance, a function or structure definition may be missing a closing curly brace, a class definition may be missing a semicolon after its closing brace, a function call or expression may have mismatched parentheses, and so on.
In addition to these common causes, one of the following reasons may have caused this error:
- The default disk drive did not contain sufficient space for compiler-generated temporary files. The space required is approximately two times the size of the source file.
- An #if directive evaluates to false without a corresponding closing #endif directive.
- The precompiled headers option (/Yu) is enabled but the file doesn't contain a hdrstop pragma.
- The /Yufilename option is used and the source file being compiled does not contain an #include "filename"
directive that uses the same filename used with /Yu.
- A source file does not end with a carriage return–linefeed pair.
Tips
- Make sure that each opening brace has a matching closing brace.
- Make sure that each opening parenthesis has a matching closing parenthesis.
- Make sure all class definitions have a semicolon after the closing brace for the class.
- When using C-style comments (i.e. /* ... */), make sure there is a closing asterisk-slash ( */ ) combination.
意外的文件结尾处找到
编译器达到一个源文件的结尾不解决的构建体。
例如,一个功能或结构定义可能缺少右大括号,一类定义可能会闭幕括号后丢失分号,函数调用或表达可能有不匹配的括号,并依此类推。
除了这些常见的原因,有下列原因之一,可能导致此错误:
默认的磁盘驱动器不包含编译器生成的临时文件足够的空间。所需的空间是源文件的大小约两倍。
一个#if指令计算结果为false没有相应的收盘#endif指令。
预编译头选项(/羽)已启用,但该文件不包含hdrstop后面附注。
在/ Yufilename选项用于和源文件被编译不包含使用带有/于使用相同的文件名的的#include“文件名”指令。
源文件不以回车换行符对端。
提示
确保每个左括号有一个匹配的右括号。
编译器达到一个源文件的结尾不解决的构建体。
例如,一个功能或结构定义可能缺少右大括号,一类定义可能会闭幕括号后丢失分号,函数调用或表达可能有不匹配的括号,并依此类推。
除了这些常见的原因,有下列原因之一,可能导致此错误:
默认的磁盘驱动器不包含编译器生成的临时文件足够的空间。所需的空间是源文件的大小约两倍。
一个#if指令计算结果为false没有相应的收盘#endif指令。
预编译头选项(/羽)已启用,但该文件不包含hdrstop后面附注。
在/ Yufilename选项用于和源文件被编译不包含使用带有/于使用相同的文件名的的#include“文件名”指令。
源文件不以回车换行符对端。
提示
确保每个左括号有一个匹配的右括号。