0

我的头文件中有一些错误,我不知道如何修复,因为我对 C++ 还很陌生。

下面是头文件的代码:

#pragma once

typedef unsigned int uint;

class DCEncryption
{
public:
    static char* manageData(char*, char*, uint);

private:
    static int max(int, int);
    static uint leftRotate(uint, int);
};

以下是错误:

 - dcencryption.h(12): error C2062: type 'int' unexpected
 - dcencryption.h(12): error C2334: unexpected token(s) preceding ':'; skipping apparent function body
 - dcencryption.h(12): error C2760: syntax error : expected '{' not ';'
 - dcencryption.h(13): error C2144: syntax error : 'uint' should be preceded by '}'
 - dcencryption.h(13): error C2143: syntax error : missing ')' before ';'
 - dcencryption.h(13): error C2059: syntax error : ')'
 - dcencryption.h(13): error C2143: syntax error : missing ';' before ')'
 - dcencryption.h(13): error C2238: unexpected token(s) preceding ';'
4

1 回答 1

4

您可能在 Windows 上,并且在包含显示的文件之前,您已经从主文件中windef.h直接或间接(windows.h可能通过 )包含。.cpp

碰巧的max是,在您的上下文中定义的宏windef.h不能很好地扩展。

这也很容易在其他一些平台上发生。

于 2012-05-24T20:14:44.217 回答