我正在测试eclipse C for Mac . 我有三个具体问题 .

  • 这是Mac的经典iostream问题 . 它不知道在哪里找到它 . 所以在项目属性中我添加了iostream所在的路径(Preferences-> C / C General-> Paths and Symbols-> includes) . 现在iostream有效 . 但我试图找到一种方法,我不必为每个新项目都这样做 . 是否有特定设置我可以选择自动为每个新项目包含此目录?

  • eclipse是否需要xCode才能工作?如果是的话,如果没有它,我怎么能让eclipse工作? xCode占用6 GB .

  • 我在测试项目上遇到错误(见下文),我不确定如何修复 . 关于“链接器命令失败”的事情 . 我似乎能够很好地编译常规的C程序 . 请注意,此项目在Visual Studio中工作正常 .

23:37:30 ****增量构建配置调试项目pointClass *使所有构建目标:pointClass调用:MacOS X C Linker g -o "pointClass" ./point.o ./test.o
体系结构x86_64的未定义符号:"std::istream::operator>>(double&)",引用自:test.o中的_main“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&)“,引自:测试中的_main . o ld:找不到架构x86_64 clang的符号:错误:链接器命令失败,退出代码为1(使用-v查看调用)make:
[pointClass]错误1