1

我有一个文件,其中包含一个头文件。但是在编译时我遇到了很多was not declared in this scope错误,这很奇怪,因为我在头文件中声明/包含了我需要的所有内容。这是头文件

#ifndef INPUT_H
#define INPUT_H
#include <map>
#include <functional>
#include <SDL/SDL.h>
using namespace std;
multimap <SDL_EventType, function<void(SDL_Event&)>> functions;

template <typename T>
void registerInput(SDL_EventType type, T&& functionPointer);
#endif

这是源文件:

#include "input.h"
template <typename T>
void registerInput(SDL_EventType type, T&& functionPointer){
    functions.insert(pair<SDL_EventType, function<void(SDL_Event&)> >(type, functionPointer));
}

编译错误:

input.cpp:3:20: error: ‘SDL_EventType’ was not declared in this scope. 

我究竟做错了什么?

4

0 回答 0