为什么C++不知道TIMESTAMP_STRUCT类型

Why C++ not know TIMESTAMP_STRUCT type?

本文关键字:STRUCT 类型 TIMESTAMP C++ 不知道 为什么      更新时间:2023-10-16

我使用Visual Studio 2005

当我编译时,我得到了这个错误:

错误1错误C2146:语法错误:缺少";"在标识符"mDropEndTime"之前

错误2错误C4430:缺少类型说明符-假定为int。注意:C++不支持默认的int

struct MB_SYN_DROPITEM_UPDATE : MSGBUF
{
    long                    mCid;           // Index
    unsigned long           mItemIdx;       // idx
    TIMESTAMP_STRUCT        mDropEndTime;   // This is error line
};

为什么C++不知道TIMESTAMP_STRUCT

TIMESTAMP_STRUCT是sqlext.h 中定义的内容

您必须添加

#include <sqlext.h>

因为TIMESTAMP_STRUCT不是C++标准的一部分。