起因來自於OS課程作業需要用vm ware跑redhat下使用nachos 重點來自於要安裝nachos時要make 就出現了下面的回應 [root@localhost code]# make cd threads; gmake depend gmake[1]: Entering directory `/root/nachos-4.0/code/threads' g++ -Wno-deprecated -I../lib -I../threads -I../machine -DTHREADS -Dx86 -DLINUX - DBSD -M ../lib/bitmap.cc ../lib/debug.cc ../lib/hash.cc ../lib/libtest.cc ../lib /list.cc ../lib/sysdep.cc ../machine/interrupt.cc ../machine/stats.cc ../machine /timer.cc ../threads/alarm.cc ../threads/kernel.cc ../threads/main.cc ../threads /scheduler.cc ../threads/synch.cc ../threads/synchlist.cc ../threads/thread.cc . /machine/elevatortest.cc ../machine/elevator.cc > makedep /bin/sh: line 1: g++: command not found gmake[1]: *** [depend] Error 127 gmake[1]: Leaving directory `/root/nachos-4.0/code/threads' make: *** [all] Error 2 後來知道是忘記把nachos置放在/usr/local底下 再重新make 仍是不行 開始懷疑自己的系統是不是沒有安裝gcc編譯器 輸入指令後 系統給予的回應是 not found gcc 開始試著照下面網頁的指示下載安裝 http://bc.webwoo.net/bencandy-59-28107-1.htm 不過 一直到真正安裝的時候 輸入了 [root@localhost root]# /root/gcc-3/gcc-3.3.6/configure --prefix=/usr/local/gcc-3.3.6 系統給了這樣的回應 onfiguring for a i686-pc-linux-gnu host. Created "Makefile" in /root using "mt-frag" /root/gcc-3/gcc-3.3.6/configure: line 8: cc: command not found *** The command 'cc -o conftest -g conftest.c' failed. *** You must set the environment variable CC to a working compiler. 所以我就想說接下來是要設定環境變數cc才能解決的樣子 看了一下鳥哥私房菜 也沒有提到環境變數cc 我就卡住了 >"< 說到底 我只是想要安裝gcc而已 ps: 我有試過要利用當初安裝redhat時使用的iso檔來安裝gcc 輸入了這些指令 $ rpm -Uvh binutils-2.13.90.0.18-9.i386.rpm $ rpm -Uvh cpp-3.2.2-5.i386.rpm $ rpm -Uvh glibc-devel-2.3.2-11.9.i386.rpm 不過 系統回應是找不到檔案 雖然我已經掛載到vm ware的光碟機上 現在就沒什麼頭緒 真的自己try了很久還是不行 煩請大大幫忙 現在連安裝都還不行 連作業也寫不成 >"< -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.216.242.125 ※ 編輯: polaristing 來自: 61.216.242.125 (05/11 11:35)