我正在做一个共享项目。我遇到了一些标识符错误,VS C++ 2005 不知道 CRITICAL_SECTION 和 LPCRITICAL_SECTION。
LPCRITICAL_SECTION GetReadCS() { return &m_ReadCS; }
LPCRITICAL_SECTION GetWriteCS() { return &m_WriteCS; }
和
CRITICAL_SECTION m_ReadCS;
CRITICAL_SECTION m_WriteCS;
并得到了一些错误
warning C4183: 'GetReadCS': missing return type; assumed to be a member function returning 'int'
warning C4183: 'GetWriteCS': missing return type; assumed to be a member function returning 'int'
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error C2146: syntax error : missing ';' before identifier 'm_WriteCS'
为什么 LPCRITICAL_SECTION 和 CRITICAL_SECTION 未定义?如何让 C++ 知道它?