ここに私のヘッダーがありlevel.h
ます:
#ifndef LEVEL_H_
#define LEVEL_H_
#include <string>
#include <map>
#include <queue>
#include <list>
typedef struct {
std::string title;
int stepsAmount;
std::queue <std::list <char> > steps;
std::queue <std::map <std::string, int> > stepsOptions;
} Level;
std::string getCurrentStepExpression(Level* level);
#endif
そして私のlevel.cpp
:
#include "level.h"
std::string getCurrentStepExpression(Level* level) {
std::string result;
if (level)
result = level->stepExpressions.front();
return result;
}
すべて問題ないようですが、コンパイラは次のように述べています。
..\level.cpp: In function 'std::string getCurrentStepExpression(Level*)':
..\level.cpp:12:19: error: 'struct Level' has no member named 'stepExpressions'
構造体のフィールドが表示されないのはなぜですか?