C++11 Xcode 7.2 can';找不到c++;std::pair

C++11 Xcode 7.2 can';找不到c++;std::pair,c++11,xcode7,C++11,Xcode7,首先,我在OSX 10.11.2上使用Xcode 7.2。在我的main.cpp文件中,std库工作正常。但是,每当我尝试在其他C++文件中使用它时,我会得到意外的不合格ID > < /P> 我有以下文件: main.cpp (std is working in it) algo.hpp (std is not working in it) algo.cpp (std is not working in it) 为什么部署目标OSX 10.11在所有文件中找不到标准C++库?< /P>

首先,我在OSX 10.11.2上使用Xcode 7.2。在我的main.cpp文件中,std库工作正常。但是,每当我尝试在其他C++文件中使用它时,我会得到<代码>意外的不合格ID > < /P> 我有以下文件:

main.cpp (std is working in it)

algo.hpp (std is not working in it)

algo.cpp (std is not working in it)

为什么部署目标OSX 10.11在所有文件中找不到标准C++库?< /P> 下面是我的头文件algo.hpp的示例

#ifndef algo_hpp
#define algo_hpp

std::pair<unsigned int, unsigned int> pgcdFB(const int m,const int n);

std::pair<unsigned int, unsigned int> euclide(const int m, const int n);

unsigned int fibonacci(const unsigned int i);

#endif /* algo_hpp */
\ifndef algo\u水电站
#定义algo_水电站
std::成对pgcdFB(常数int m,常数int n);
std::成对欧几里德(常数int m,常数int n);
无符号整数fibonacci(常数无符号整数i);
#endif/*阿尔戈水电站*/

在我使用std的每一行中,我都会得到未声明的标识符std,你必须包含正确的标题,你只是忘记了
#include
,因为你使用的是
std::pair
。(这里似乎没有理由包含stdio.h)

您能显示出不起作用的代码行,以及您得到的确切错误吗?