On 5 Oct 2004, Kamlesh Kumar M. moaned: > I have a source code tree (say x) that contains a directory named as specs. > while compiling this source code I am getting following error > c++: ./specs: Is a directory > > what is the reason ? GCC thinks that its `specs file' (a semi-internal undocumented text file which adds a pile of default switches when the compiler is asked to do certain things) is in your current directory; it's trying to open it and erroring because it's a directory. This is most unusual: GCC isn't meant to look in the current directory for specs files at all. Some environment variables can be set which can change in which directory the search happens: if any of these have either the current directory or a trailing path separator (`:', `;', or something else depending on OS), then the specs search will iterate through the current directory and get errors like this. In GCC 3.4.2, the GCC_EXEC_PREFIX, LIBRARY_PATH and LPATH variables could under sufficiently obscure circumstances cause GCC to look there, as will the -B switch (normally used only when bootstrapping GCC itself). Also, if you're compiling stuff in one of the directories where GCC's internal binaries are located, and you create a directory called `specs' in there, you could expect to get this. Solution: don't do that. :) In general, though, you need an already-damaged installation of GCC to cause this to happen, as by default the copy of the specs in the GCC tooldir should be found (because that's the location that's searched first). The output of `gcc -v' may help: it says (among other things) where GCC is looking for specs files. e.g. on this box here it says Reading specs from /usr/packages.bin/gcc/3.4.2/bin/../lib/gcc/sparc-unknown-linux-gnu/3.4.2/specs Configured with: /usr/packages/gcc/core/configure --with-gnu-ld --with-gnu-as --enable-shared --disable-static --prefix=/usr --verbose --enable-threads --with-system-zlib --enable-__cxa_atexit Thread model: posix gcc version 3.4.2 and on a randomly selected Debian box running a rather older GCC located in a rather more conventional place in the filesystem, it says Reading specs from /usr/lib/gcc-lib/i486-linux/3.3.4/specs Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i486-linux Thread model: posix gcc version 3.3.4 (Debian 1:3.3.4-13) (look at the first line). -- `[...] I certainly enjoyed putting it down. Perhaps I would have enjoyed putting it down even more if I were a veterinarian.' --- Mike Andrews on Dan Brown's _Digital Fortress_