【发布时间】:2010-09-13 06:20:40
【问题描述】:
如果我运行 make 那么我如何判断使用的是 gcc 还是 g++?我试图查看 Makefile 但没有找到任何东西。
这是 make 的输出。我也想不通。
cd threads; make depend
make[1]: Entering directory `/home/anthony/nachos-4.0/code/threads'
g++ -I../lib -I../threads -I../machine -DTHREADS -Dx86 -DLINUX -DCHANGED -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
In file included from ../lib/debug.h:18,
from ../lib/bitmap.cc:10:
../lib/sysdep.h:15:22: error: iostream.h: No such file or directory
In file included from ../lib/debug.h:18,
from ../lib/debug.cc:11:
../lib/sysdep.h:15:22: error: iostream.h: No such file or directory
In file included from ../lib/debug.h:18,
from ../lib/list.h:17,
from ../lib/libtest.cc:12:
../lib/sysdep.h:15:22: error: iostream.h: No such file or directory
In file included from ../lib/debug.h:18,
from ../lib/sysdep.cc:27:
../lib/sysdep.h:15:22: error: iostream.h: No such file or directory
In file included from ../lib/debug.h:18,
from ../lib/list.h:17,
from ../machine/interrupt.h:39,
from ../machine/interrupt.cc:24:
../lib/sysdep.h:15:22: error: iostream.h: No such file or directory
In file included from ../lib/debug.h:18,
from ../machine/stats.cc:11:
../lib/sysdep.h:15:22: error: iostream.h: No such file or directory
In file included from ../lib/debug.h:18,
from ../threads/main.h:13,
from ../machine/timer.cc:24:
../lib/sysdep.h:15:22: error: iostream.h: No such file or directory
In file included from ../lib/debug.h:18,
from ../threads/main.h:13,
from ../threads/alarm.cc:13:
../lib/sysdep.h:15:22: error: iostream.h: No such file or directory
In file included from ../lib/debug.h:18,
from ../threads/kernel.cc:9:
../lib/sysdep.h:15:22: error: iostream.h: No such file or directory
In file included from ../lib/debug.h:18,
from ../threads/main.h:13,
from ../threads/main.cc:21:
../lib/sysdep.h:15:22: error: iostream.h: No such file or directory
In file included from ../lib/debug.h:18,
from ../threads/scheduler.cc:22:
../lib/sysdep.h:15:22: error: iostream.h: No such file or directory
In file included from ../threads/thread.h:42,
from ../threads/synch.h:21,
from ../threads/synch.cc:36:
../lib/sysdep.h:15:22: error: iostream.h: No such file or directory
In file included from ../lib/debug.h:18,
from ../lib/list.h:17,
from ../threads/synchlist.h:14,
from ../threads/synchlist.cc:13:
../lib/sysdep.h:15:22: error: iostream.h: No such file or directory
In file included from ../threads/thread.h:42,
from ../threads/thread.cc:20:
../lib/sysdep.h:15:22: error: iostream.h: No such file or directory
In file included from ../lib/debug.h:18,
from ../lib/list.h:17,
from ../machine/elevator.h:24,
from ../machine/elevatortest.cc:13:
../lib/sysdep.h:15:22: error: iostream.h: No such file or directory
In file included from ../lib/debug.h:18,
from ../lib/list.h:17,
from ../machine/elevator.h:24,
from ../machine/elevator.cc:11:
../lib/sysdep.h:15:22: error: iostream.h: No such file or directory
make[1]: *** [depend] Error 1
make[1]: Leaving directory `/home/anthony/nachos-4.0/code/threads'
make: *** [all] Error 2
【问题讨论】:
-
第三行是
g++,文件都是.cc,所以需要g++。 -
这是否意味着它没有使用gcc?
-
我怀疑你真正的问题是为什么找不到 iostream.h 头文件。我修改了我的答案来回答这个问题。如果事实证明这是您的问题,我将在此处修改问题,以便人们在搜索时可以找到它。