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

文章详细记录了使用Microsoft Visual Studio 2005 Professional Edition进行Excel编程时遇到的多种错误,如缺少类型说明符、语法错误等问题,并提供了具体的解决办法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

缺少类型说明符 - 假定为 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 个警告




产生问题的原因:

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

解决办法:

加上类型就可以了!·

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值