[SOLVED] the aforementioned "#include <errno.h>" error

Dan Kegel dank@kegel.com
Tue Dec 6 16:42:00 GMT 2005


On 12/6/05, Robert P. J. Day <rpjday@mindspring.com> wrote:
>   oh, man.  i just figured out why i couldn't cross-compile a source
> file with my newly-generated toolchain.  from the source tree i
> inherited, i had a source file that included
>
>   #include <errno.h>
>
> ok, that looks reasonable enough.  but i hadn't noticed that the
> actual compile command included the option "-I./include", where that
> local include directory included (you guessed it) a file called
> "errno.h"

Gaaah!

I've also been bitten in the past by creating a directory named 'new'.
That caused
  #include <new>
to fail in C++ programs.

Two tricks can help figure these things out:
1. use the -H option to gcc.  This prints out the exact header files used!
2. run the compiler under strace -f -olog, then grep through 'log' for
    stat and open calls.  Works when trick #1 doesn't, e.g. when
figuring out linker
    problems.
- Dan

--
Why won't Johnny run Linux?  See http://kegel.com/linux/comfort

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com



More information about the crossgcc mailing list