看板 Linux 關於我們 聯絡資訊
我只裝過一次Linux, 是Ubuntu, 完全不會Linux, 但是因為作業指定必須使用glibc來寫, 所以我有以下問題: 1. 我在windows底下必須安裝譬如visual c之類的 compiler/IDE才能compile寫出來的c code, 那請問所謂的glibc compiler是在我Linux裝完之後就已經內建在系統裡了嗎? 2. 如上題為否, 請問我要怎麼安裝glibc呢? (有文件可以看嗎) 如上題為是, 那是指我進入console模式, 隨便在一個資料夾下面寫c code都可以compile嗎? 3. 我不太清楚要怎麼compile, 或者是說我不太清楚gcc跟glibc的差別, 不過就以流程上, 我就include glibc的function到我的c code, 然後在console模式下用gcc進行compile, 是這樣嗎? 謝謝回答. -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.228.175.62
dou0228:能開完一般的distro 就肯定有 glibc,你缺的是 devel 03/05 02:06
kdjf:glibc就是一個library gcc是conpiler(在devel中) 03/05 07:42
klain:請問"一般的distro"是指Linux如Ubuntu/Mandrake/Redhat嗎? 03/05 08:26
klain:"devel"是指develop tool? 03/05 08:26
klain:抱歉我換個問法, 我不怕寫C, 但是對Linux完全不懂, 請問我要 03/05 08:27
klain:怎麼樣弄出一個環境讓我寫C且可以compile呢? 03/05 08:27
in09:ubuntu 裝完, command line 打 gcc 就可以 compile 了 03/05 08:39
legendmtg:ubuntu預設沒gcc吧? 03/05 12:12
klain:那請問ubuntu要怎麼開始撰寫c並且compile呢? 03/05 13:31
chroot:vi a.c. Type this: 03/05 13:37
chroot:#include<stdio.h> 03/05 13:37
chroot:int main(){ 03/05 13:37
chroot:printf("hello world");return 0; 03/05 13:37
chroot:} 03/05 13:37
chroot:then, gcc a.c 03/05 13:37
chroot:然後會跑出執行檔"a.out",再下./a.out去跑就ok了 03/05 13:38
in09:ubuntu 9.04 有啊, 我光碟放進去,一切自動,裝完就有gcc啊 03/05 14:46
in09:原PO是不是只會用VC那種UI介面,要用mouse點一下某按鈕才能動 03/05 15:33
in09:的? 那在Linux裏可能要裝一些別的..<-請google Linux IDE之類 03/05 15:35
soem:原PO應該是需要類似netbeans或eclipse這種IDE~ 03/05 17:12