在visual studio 2013上使用std :: function <void>

Lef*_*ler 4 xcode sfml c++11 visual-studio-2013

我正在将我的项目从mac os x(xcode)转换为windows(visual studio 2013).但是当我尝试使用std :: function时,我遇到了问题.作为一个例子,我宣布.

std::function<void()> processFunc;
Run Code Online (Sandbox Code Playgroud)

但是我得到了几个错误:

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
Run Code Online (Sandbox Code Playgroud)

在XCode上我需要启用c ++ 11,但从我在研究中看到的VS 2013启用了C++ 11.

我唯一的C++包括iostream

我应该添加另一个包含?

小智 8

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