Eclipse C++ for Mac settings (<iostream> fix) and error correction

I am testing out eclipse C++ for Mac. I have three specific questions.

  • This is the classic iostream problem for Mac. It does not know where to find it. So in the project properties I add the path where iostream is located (Preferences->C/C++ General->Paths and Symbols->includes). Now iostream works. But I am trying to find a way where I don't have to do this for every new project. Is there a specific setting I can select to include this directory automatically for each new project?

  • Is xCode necessary for eclipse to work? If yes, how can I get eclipse to work without it? xCode takes up 6 GBs.

  • I'm getting an error on a test project (see below) that I'm not sure how to fix. Something about "linker command failed". I seem to be able to compile regular C programs fine though. Note this project works fine in Visual Studio.

    23:37:30 **** Incremental Build of configuration Debug for project pointClass **** make all Building target: pointClass Invoking: MacOS X C++ Linker g++ -o "pointClass" ./point.o ./test.o
    Undefined symbols for architecture x86_64: "std::istream::operator>>(double&)", referenced from: _main in test.o "std::ostream::operator<<(std::ostream& ()(std::ostream&))", referenced from: _main in test.o Point::Point(double, double) in test.o Point::Point(Point const&) in test.o "std::ostream::operator<<(double)", referenced from: _main in test.o Point::Point(double, double) in test.o "std::basic_string, std::allocator >::~basic_string()", referenced from: _main in test.o "std::ios_base::Init::Init()", referenced from: ___cxx_global_var_init in test.o "std::ios_base::Init::~Init()", referenced from: ___cxx_global_var_init in test.o "std::cin", referenced from: _main in test.o "std::cout", referenced from: _main in test.o Point::Point(double, double) in test.o Point::Point(Point const&) in test.o "std::basic_ostream >& std::endl >(std::basic_ostream >&)", referenced from: _main in test.o Point::Point(double, double) in test.o Point::Point(Point const&) in test.o "std::basic_ostream > & std::operator<< >(std::basic_ostream >&, char const)", referenced from: _main in test.o Point::Point(double, double) in test.o Point::Point(Point const&) in test.o "std::basic_ostream >& std::operator<<, std::allocator >(std::basic_ostream >&, std::basic_string, std::allocator > const&)", referenced from: _main in test.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [pointClass] Error 1

  • 链接地址: http://www.djcxy.com/p/85074.html

    上一篇: 在超过4GB内存的卡上检索视频卡内存

    下一篇: Eclipse C ++ for Mac设置(<iostream>修复)和纠错