符号'cout'无法解析Eclipse CDT Fedora

时间:2014-01-17 07:16:52

标签: c++ eclipse fedora eclipse-cdt

为Fedora安装了eclipse CDT插件。

当我尝试构建我的项目时,它失败并且表示无法解析符号cout。 我需要以某种方式链接库,但我似乎无法使它工作。

iostream文件位于/usr/include/c++/4.8.2/iostream 我去了属性,C / C ++ Build,Settings,

我应该在包含中使用哪种文件路径?

我应该在GCC C ++ Linker,Libraries

中包含哪些库搜索路径和库

请帮助我一直试图让这个简单的程序工作4-5个小时。

#include <iostream>
using namespace std;

int main()
{
    cout << "test";
    return 0;

}

这是错误:

20:28:10 **** Incremental Build of configuration Debug for project test ****
make all 
Building target: test
Invoking: GCC C++ Linker
g++  -o "test"  ./test.o   
/usr/lib/gcc/x86_64-redhat-linux/4.8.2/../../../../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
make: *** [test] Error 1

20:28:10 Build Finished (took 62ms)

0 个答案:

没有答案
相关问题