缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int,该怎么解决

来源:互联网 发布:时时彩后二缩水软件 编辑:程序博客网 时间:2024/06/09 21:21
缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
使用的是Microsoft Visual Studio 2005 professional edition,excel用的2003,也是添加完了所需的application,workbook,worksheets等类,但是编译时抛excel.tlh狂多定义的错误。

1>e:\program\testexcel\testexcel\debug\excel.tlh(68519) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>e:\program\testexcel\testexcel\debug\excel.tlh(68519) : warning C4183: “GetLanguageSettings”: 缺少返回类型;假定为返回“int”的成员函数
1>e:\program\testexcel\testexcel\debug\excel.tlh(68524) : error C2146: 语法错误 : 缺少“;”(在标识符“GetAnswerWizard”的前面)
1>e:\program\testexcel\testexcel\debug\excel.tlh(68524) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>e:\program\testexcel\testexcel\debug\excel.tlh(68524) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>e:\program\testexcel\testexcel\debug\excel.tlh(68524) : warning C4183: “GetAnswerWizard”: 缺少返回类型;假定为返回“int”的成员函数
1>e:\program\testexcel\testexcel\debug\excel.tlh(68585) : error C2146: 语法错误 : 缺少“;”(在标识符“GetFileDialog”的前面)
1>e:\program\testexcel\testexcel\debug\excel.tlh(68585) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>e:\program\testexcel\testexcel\debug\excel.tlh(68586) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>e:\program\testexcel\testexcel\debug\excel.tlh(68586) : warning C4183: “GetFileDialog”: 缺少返回类型;假定为返回“int”的成员函数
1>e:\program\testexcel\testexcel\debug\excel.tlh(68608) : error C2146: 语法错误 : 缺少“;”(在标识符“GetNewWorkbook”的前面)
1>e:\program\testexcel\testexcel\debug\excel.tlh(68608) : fatal error C1003: 错误计数超过 100;正在停止编译
1>生成日志保存在“file://e:\program\TestExcel\TestExcel\Debug\BuildLog.htm”

1>TestExcel - 222 个错误,34 个警告




产生问题的原因:

声明的时候没加返回值类型.

解决办法:

加上类型就可以了!·

原创粉丝点击