亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 1214 | 回復(fù): 3
打印 上一主題 下一主題

新手請教問題 [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報(bào)告]
發(fā)表于 2012-02-22 14:16 |只看該作者 |倒序?yàn)g覽
本帖最后由 ianxia 于 2012-02-22 14:22 編輯

長期只接觸c#,突然接到任務(wù)要在linux平臺下做些開發(fā),環(huán)境不太適應(yīng),撿起學(xué)校里用的c++,發(fā)現(xiàn)了好多問題請高手解答
我用的系統(tǒng)redhat AS 5.6

1、gcc頭文件在那個(gè)目錄下。
2、linux的c++有沒有好的幫助文件和工具書,幫忙推薦下
3、有沒有比較高效的開發(fā)工具,VS用習(xí)慣了,直接使用vi編輯代碼感覺好痛苦。

寫了一段簡單代碼,編譯竟然一大堆錯(cuò)誤。

  1. #include<fstream>
  2. #include<iostream>
  3. using namespace std;
  4. int main ()
  5. {
  6.         ofstream examplefile ("example.txt",ios::out);
  7.         if (examplefile.is_open())
  8.         {
  9.             examplefile << "This is a line.\n";
  10.             examplefile << "This is another line.\n";
  11.             examplefile.close();
  12.         }
  13.         return 0;

  14. }
復(fù)制代碼
[root@localhost project]# gcc OpFile.cc
/tmp/ccOuwr7B.o: In function `__static_initialization_and_destruction_0(int, int)':
OpFile.cc.text+0x23): undefined reference to `std::ios_base::Init::Init()'
/tmp/ccOuwr7B.o: In function `__tcf_0':
OpFile.cc.text+0x6c): undefined reference to `std::ios_base::Init::~Init()'
/tmp/ccOuwr7B.o: In function `main':
OpFile.cc.text+0xa1): undefined reference to `std::basic_ofstream<char, std::char_traits<char> >::basic_ofstream(char const*, std::_Ios_Openmode)'
OpFile.cc.text+0xaf): undefined reference to `std::basic_ofstream<char, std::char_traits<char> >::is_open()'
OpFile.cc.text+0xc9): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std:perator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
OpFile.cc.text+0xdf): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std:perator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
OpFile.cc.text+0xed): undefined reference to `std::basic_ofstream<char, std::char_traits<char> >::close()'
OpFile.cc.text+0x100): undefined reference to `std::basic_ofstream<char, std::char_traits<char> >::~basic_ofstream()'
OpFile.cc.text+0x122): undefined reference to `std::basic_ofstream<char, std::char_traits<char> >::~basic_ofstream()'
/tmp/ccOuwr7B.o.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status

論壇徽章:
11
技術(shù)圖書徽章
日期:2014-03-01 14:44:34天蝎座
日期:2014-05-21 22:11:59金牛座
日期:2014-05-30 17:06:14
2 [報(bào)告]
發(fā)表于 2012-02-22 16:40 |只看該作者
g++ OpFile.cc

論壇徽章:
1
天蝎座
日期:2013-12-06 18:23:58
3 [報(bào)告]
發(fā)表于 2012-02-23 16:19 |只看該作者
C++程序 用G++編譯,可以用codeblocks,或者kdevelop,如果你是在圖形界面下,否則就用vim吧,習(xí)慣就好

論壇徽章:
0
4 [報(bào)告]
發(fā)表于 2012-02-24 14:26 |只看該作者
謝謝幫助,自己現(xiàn)在安裝了一個(gè)eclipse,開發(fā)順手多了,也不用為編譯的問題頭痛了。
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報(bào)專區(qū)
中國互聯(lián)網(wǎng)協(xié)會(huì)會(huì)員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP