eclipse indigo on mac building error C ++

时间:2012-01-04 15:59:53

标签: c++ eclipse macos

我是C ++的新手,我在mac os 10.6上安装了eclipse,但是我甚至在构建HelloWorld代码时遇到了问题。每次收到此消息:

make all 
Building target: testc++1
Invoking: MacOS X C++ Linker
g++  -o "testc++1"  ./src/testc++1.o   
Undefined symbols:
  "std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)", referenced from:
      _main in testc++1.o
  "std::ios_base::Init::Init()", referenced from:
      __static_initialization_and_destruction_0(int, int)in testc++1.o
  "___gxx_personality_v0", referenced from:
      ___gxx_personality_v0$non_lazy_ptr in testc++1.o
     (maybe you meant: ___gxx_personality_v0$non_lazy_ptr)
  "std::ios_base::Init::~Init()", referenced from:
      ___tcf_0 in testc++1.o
  "std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)", referenced from:
      __ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_$non_lazy_ptr in testc++1.o
     (maybe you meant: __ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_$non_lazy_ptr)
  "std::basic_ostream<char, std::char_traits<char> >::operator<<(std::basic_ostream<char, std::char_traits<char> >& (*)(std::basic_ostream<char, std::char_traits<char> >&))", referenced from:
      _main in testc++1.o
  "std::cout", referenced from:
      __ZSt4cout$non_lazy_ptr in testc++1.o
     (maybe you meant: __ZSt4cout$non_lazy_ptr)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [testc++1] Error 1

**** Build Finished ****

0 个答案:

没有答案