0
語境:我有它有兩個include
條款一類:的#include重複
#ifndef VAR_RECORD_SONG_H
#define VAR_RECORD_SONG_H
#include "VarRecord.h"
#include "Compressor.h"
class VarRecordSong : public VarRecord
{
public:
VarRecordSong();
~VarRecordSong();
};
#endif /* VAR_RECORD_SONG_H */
問題:既VarRecord.h
和Compressor.h
使用相同的文件GlobalConstants.h
,如此明顯的編譯器抱怨。
與[VarRecordSong.h]一樣,將[Include guard](http://en.wikipedia.org/wiki/Include_guard)放到'GlobalConstants.h'中? –
@Haroogan大聲笑你是對的。謝謝。 –