|
藍森林 http://www.lslnet.com 2006年6月6日 10:18
在Redhat9為什麼不能#include <iostream>
//test.cxx
//redhat9 下編程
#include <iostream>;
int main(void)
{
return 0;
}
gcc text.cxx出錯
是不是環境問題,出錯嗎?沒有設置path的關係?
出錯返回信息:
/tmp/ccqt6GzH.o(.text+0x36): In function `__static_initialization_and_destruction_0(int, int)':
: undefined reference to `std::ios_base::Init::Init[in-charge]()'
/tmp/ccqt6GzH.o(.text+0x65): In function `__tcf_0':
: undefined reference to `std::ios_base::Init::~Init [in-charge]()'
/tmp/ccqt6GzH.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status |
在Redhat9為什麼不能#include <iostream>
-->
g++ foo.cxx |
在Redhat9為什麼不能#include <iostream>
樓主,你寫的是c++的程序,所以當然要用g++來編譯了! |
在Redhat9為什麼不能#include <iostream>
g++只不過是簡化了gcc的操作.
gcc -o test test.cxx -lstdc++ |
在Redhat9為什麼不能#include <iostream>
#include <iostream.h>;
或
#include <iostream>;
using namespace std;
我也是剛找到的:) |
在Redhat9為什麼不能#include <iostream>
同意樓上的回答
不知道對不對 |
| |