Node:Missing subprograms, Next:, Previous:GCC optimizations, Up:Trouble

6.5 Why does GCC say "cannot exec as"?

Q: When I try compiling a program, GCC aborts saying "Installation problem, cannot exec `as': No such file or directory (ENOENT)". What does that mean?

Q: When I try compiling a program, GCC aborts saying "Installation problem, cannot exec `cpp': No such file". Huh?

A: This usually means that GCC couldn't find some program it needs to run to compile your source. Check the COMPILER_PATH environment variable or what the COMPILER_PATH line in the DJGPP.ENV file says, and make sure they point to the directory where DJGPP programs reside. Also check that the named directory has all the required programs: cpp.exe, cc1.exe, cc1plus.exe, cxxfilt.exe, gasp.exe, as.exe, ld.exe, and (for Objective-C) cc1obj.exe. A typical case is when people fail to install the Binutils package and GCC cannot find as.exe (the assembler) and ld.exe (the linker). You can use the -v switch to GCC to see what programs it invokes and which one of them causes the fatal error.

Beginning with version 2.8.0 of GCC, the place where the pre-processor, cpp.exe, and the C and C++ compilers, cc1.exe and cc1plus.exe, are installed, has changed: they are no more in the same directory as gcc.exe itself. If you are using GCC version 2.8.0 or later, and the compiler cannot find cpp.exe or cc1plus.exe, read the installation instructions carefully: the file problems.txt explains how to change the settings on DJGPP.ENV so that GCC will find the pre-processor. Also, be sure to remove all traces of the previous compiler installation, since mixing different compiler versions can be another cause for such problems. See uninstalling a package.