Usually the Gnu compiler finds its include path automatically in
the same folder where the compiler was found. That didn't work, so
either the include directory is missing or the compiler couldn't
figure out where it was (maybe because it's accessed via a symbolic
link, or because the directory naming scheme is non-standard). If
the directory isn't missing, you need to point the compiler to it,
-S -O2 -fno-delayed-branch lab4_ex4.c -o lab4_ex4.s
This assumes your directory naming scheme matches the one for
my compiler. You need to substitute the real path to the
I didn't need to do any of the above with my compiler. I built it
myself as "mipsisa32-elf-gcc". Here is how it's installed:
My compiler is in "/install-path/mipsisa32-elf/bin/".
The path variable is "PATH=$PATH:/install-path/mipsisa32-elf/bin".
The include directory is:
I can compile with this command, and the compiler finds the
include path automatically:
mipsisa32-elf-gcc -c -O2 test.c
If this all doesn't get you going, I recommend you install a
different version of GCC. The MIPS company has one called
"SDE-Lite" for free, and it's likely to be better supported
than the one you have. You can get it from here:
This one also has some documentation, although it might be
confusing with all the options available.