在Visual Studio 2013上使用std :: function

问题描述:

我将我的项目从mac os x(xcode)转换为windows(visual studio 2013)。 但我有问题,当我尝试使用std ::函数。 作为我声明的一个例子。在Visual Studio 2013上使用std :: function <void>

std::function<void()> processFunc; 

,但我得到几个错误:

Error 1 error C2039: 'function' : is not a member of 'std' ...github\oglengine\engine\game.h 39 1 Engine 
Error 2 error C2143: syntax error : missing ';' before '<' ...github\oglengine\engine\game.h 39 1 Engine 
Error 3 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int ...github\oglengine\engine\game.h 39 1 Engine 

在XCode中我需要使C++ 11,但是从我所看到的在我的研究VS 2013有C++ 11使。

我唯一的C++包括iostream

我应该添加另一个include?

我相信你需要在VS.中的#include <functional>