c++:缺少类型说明符-假定为int
visual error C4430 c++ : missing type specifier - int assumed
我正在创建带有指纹机的win7日志应用程序,指纹机sdk提供UFScanner.h头文件,当我试图在我的。cpp代码中使用"UFS_STATUS"时它给了我这些错误:
错误1 C4430:缺少类型说明符-假设为int。注意:c++不支持default-int
错误2错误C2086: 'int ufs_res':重定义
#ifndef _UFSCANNER_H_
#define _UFSCANNER_H_
#define __extension__
#ifdef UFS_EXPORTS
#define UFS_API __declspec(dllexport) __stdcall
#else
#define UFS_API __stdcall
#endif
#define UFS_CALLBACK __stdcall
#ifdef __cplusplus
extern "C" {
#endif
// Status Definition
#define UFS_STATUS int
// Status Return Values
#define UFS_OK 0
#define UFS_ERROR -1
#define UFS_ERR_NO_LICENSE -101
#define UFS_ERR_LICENSE_NOT_MATCH -102
#define UFS_ERR_LICENSE_EXPIRED -103
#define UFS_ERR_NOT_SUPPORTED -111
#define UFS_ERR_INVALID_PARAMETERS -112
...
和。cpp代码:
#include
#include
#ifndef WIN32_NO_STATUS
#include
#define WIN32_NO_STATUS
#endif
#include
#include "CSampleCredential.h"
#include "guid.h"
#include "windows.h"
#include "UFScanner.h"
#define __extension__
#define TEMPLATE_SIZE 384
UFS_STATUS ufs_res;
int nScannerNumber;
ufs_res = UFS_Init(); //ufs_res gives error : this declaration has no storage class or type specifier
...
不能在函数外部放置普通的赋值语句:
ufs_res = UFS_Init();
你需要像这样把它和ufs_res
的定义结合起来:
UFS_STATUS ufs_res = UFS_Init();
相关文章:
- 缺少类型说明符 - 假定为 int.注意 c++ 不支持 default-int
- 错误:C4430:缺少类型说明符-假定为int.注意:C++不支持default-int
- 缺少类型说明符 - int 假定 声明静态成员后出错
- 是无符号的int"简单类型说明符"
- 声明 Windows API 结构 (DCB) 的对象 - 错误 C4430:缺少类型说明符 - 假定为 int
- C++ printf 字段宽度说明符“.*”期望 int 不size_t
- CREATESTRUCT错误C4430:缺少类型说明符-假定为int.注意:C++不支持默认的int C:xdc
- 需要接受教育:声明"void encrypt(char*, int)"具有不同的异常说明符"
- 错误 1 错误 C4430:缺少类型说明符 - 假定为 int.注意:C++不支持默认整数
- 缺少类型说明符-假定为int错误
- 缺少类型说明符 - 假定为 int(类问题)
- 字符串无法识别?C4430:缺少类型说明符 - 假定为 int
- 模板类:错误 C4430:缺少类型说明符 - 假定为 int.注意:C++不支持默认整数
- 错误 C4430、C2146 - 缺少类型说明符 - 假定为 int.注意:C++不支持默认整数
- 预期的类型说明符,并且无法在初始化时转换“int*”
- srand(time(NULL)):错误 C4430:缺少类型说明符 - 假定为 int.注意:C++不支持默认整数
- 错误C4430:缺少类型说明符-假定为int
- 缺少类型说明符-int假定C4430错误
- VC++缺少类型说明符-假定为int.注意:C++不支持default-int
- visual C++缺少类型说明符-假定为int