Eclipse C ++ for Mac设置(<iostream> fix)和纠错</iostream>

时间:2015-01-14 04:57:14

标签: c++ eclipse macos

我正在测试用于Mac的eclipse C ++。我有三个具体问题。

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

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

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

    23:37:30 ****增量构建配置调试项目pointClass **** 做所有 构建目标:pointClass 调用:MacOS X C ++链接器 g ++ -o&#34; pointClass&#34; ./point.o ./test.o
    架构x86_64的未定义符号:   &#34; std :: istream :: operator&gt;&gt;(double&amp;)&#34;,引自:       _main in test.o   &#34; std :: ostream :: operator&lt;&lt;(std :: ostream&amp;()(std :: ostream&amp;))&#34;,引自:       _main in test.o       test ::o中的Point :: Point(double,double)       test ::o中的Point :: Point(Point const&amp;)   &#34; std :: ostream :: operator&lt;&lt;(double)&#34;,引自:       _main in test.o       test ::o中的Point :: Point(double,double)   &#34; std :: basic_string,std :: allocator&gt; :: ~basic_string()&#34;,引自:       _main in test.o   &#34; std :: ios_base :: Init :: Init()&#34;,引自:       test.o中的___cxx_global_var_init   &#34; std :: ios_base :: Init :: ~Init()&#34;,引自:       test.o中的___cxx_global_var_init   &#34; std :: cin&#34;,引自:       _main in test.o   &#34; std :: cout&#34;,引自:       _main in test.o       test ::o中的Point :: Point(double,double)       test ::o中的Point :: Point(Point const&amp;)   &#34; std :: basic_ostream&gt;&amp; std :: endl&gt;(std :: basic_ostream&gt;&amp;)&#34;,引自:       _main in test.o       test ::o中的Point :: Point(double,double)       test ::o中的Point :: Point(Point const&amp;)   &#34; std :: basic_ostream&gt;&amp;的std ::运营商LT;&LT; &gt;(std :: basic_ostream&gt;&amp;,char const )&#34;,引自:       _main in test.o       test ::o中的Point :: Point(double,double)       test ::o中的Point :: Point(Point const&amp;)   &#34; std :: basic_ostream&gt;&amp; std :: operator&lt;&lt;,lt;,std :: allocator&gt;(std :: basic_ostream&gt;&amp;,std :: basic_string,std :: allocator&gt; const&amp;)&#34;,引自:       _main in test.o ld:找不到架构x86_64的符号 clang:错误:链接器命令失败,退出代码为1(使用-v查看调用) make:*** [pointClass]错误1

0 个答案:

没有答案