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 に答える