为什么我得到"链接器命令失败,退出代码为1"?

时间:2014-03-20 01:13:39

标签: c++ xcode5

我已经做了很多寻找解决方案,但似乎无法找到解决方案。希望有人可以帮助我。这是我的源代码。

main.cpp中:

#include <iostream>
#include "a.h"

int main(int argc, const char * argv[])
{
  std::cout << x;
  return 0;
}

A.H:

#ifndef A_H
#define A_H

int x = 0;

#endif

只有在尝试在Xcode中运行时才会出现此问题。

0 个答案:

没有答案
相关问题