Page 1 of 2
gcc -- header file not found! >:(
Posted: Sat Oct 11, 2003 4:35 am
by petrusss
I'm trying to #include "defines.h" but gcc just complains all the time that the file is not found. =/
I've included other headers in the same file, but "defines.h" just won't work.
This is how I compile with gcc:
gcc -nostartfiles -nostdlib -fno-builtin -fwritable-strings -c source/*.c
Re:gcc -- header file not found! >:(
Posted: Sat Oct 11, 2003 7:43 am
by nullify
Pass the -I<path> switch to gcc to tell it where to find header files in non-standard locations.
Re:gcc -- header file not found! >:(
Posted: Sat Oct 11, 2003 7:46 am
by petrusss
nope, didn't help
Re:gcc -- header file not found! >:(
Posted: Sat Oct 11, 2003 8:17 am
by Perica
..
Re:gcc -- header file not found! >:(
Posted: Sat Oct 11, 2003 8:18 am
by Andrejus
May be your file name is something like a 'define.H' or 'Define.H', gcc is case sensitive
Re:gcc -- header file not found! >:(
Posted: Sat Oct 11, 2003 11:42 am
by petrusss
The filename is correct and the header file is in the same directory as the other files... weird =/
Re:gcc -- header file not found! >:(
Posted: Sat Oct 11, 2003 11:48 am
by Curufir
Shot in the dark
.
Did you create the defines.h file on a different OS. Eg Used a text editor on Windows and are compiling on Linux.
Re:gcc -- header file not found! >:(
Posted: Sat Oct 11, 2003 11:53 am
by petrusss
Heh, nope.
I had the same problem with a file named "k_descriptor.h", I removed the underscore and then it worked... but my defines.h doesn't have an underscore to remove =/
Re:gcc -- header file not found! >:(
Posted: Sat Oct 11, 2003 1:20 pm
by petrusss
I fixed it! wohooo
I renamed "k_descriptor.h" to "desc.h" and it worked.
GCC is kinda weird I think.
Re:gcc -- header file not found! >:(
Posted: Sat Oct 11, 2003 4:27 pm
by Curufir
Fun problem ;D.
Could it be a problem with length of filenames?
k_descriptor.h : Doesn't fit in 8.3 format
defines.h : Does
Re:gcc -- header file not found! >:(
Posted: Sat Oct 11, 2003 10:03 pm
by Chris Giese
gcc -nostartfiles -nostdlib -fno-builtin -fwritable-strings -I source -c source/*.c
Re:gcc -- header file not found! >:(
Posted: Sun Oct 12, 2003 4:13 pm
by Tim
Are you using DJGPP? It could be having problems with long file names. I'd recommend switching to Cygwin or Mingw.
Re:gcc -- header file not found! >:(
Posted: Mon Oct 13, 2003 3:34 am
by petrusss
Yup, DJGPP (easy to install;))
Re:gcc -- header file not found! >:(
Posted: Mon Oct 13, 2003 3:54 am
by Tim
If you're using Windows, I'd still recommend Cygwin or Mingw. DJGPP is DOS, so Windows has to emulate DOS in order to run it, giving large overheads (and slowing it down). Cygwin and Mingw are native Win32 programs, so they support long file names automatically, and are much faster.
Re:gcc -- header file not found! >:(
Posted: Mon Oct 13, 2003 4:06 am
by Solar
...and giving you lots of other nifty tools in the process. (astyle, grep, gpg, ssh, irc, ...)