gcc -- header file not found! >:(

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
petrusss

gcc -- header file not found! >:(

Post 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
nullify

Re:gcc -- header file not found! >:(

Post by nullify »

Pass the -I<path> switch to gcc to tell it where to find header files in non-standard locations.
petrusss

Re:gcc -- header file not found! >:(

Post by petrusss »

nope, didn't help :(
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Re:gcc -- header file not found! >:(

Post by Perica »

..
Last edited by Perica on Sun Dec 03, 2006 9:21 pm, edited 1 time in total.
Andrejus

Re:gcc -- header file not found! >:(

Post by Andrejus »

May be your file name is something like a 'define.H' or 'Define.H', gcc is case sensitive
petrusss

Re:gcc -- header file not found! >:(

Post by petrusss »

The filename is correct and the header file is in the same directory as the other files... weird =/
Curufir

Re:gcc -- header file not found! >:(

Post 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.
petrusss

Re:gcc -- header file not found! >:(

Post 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 =/
petrusss

Re:gcc -- header file not found! >:(

Post by petrusss »

I fixed it! wohooo :)
I renamed "k_descriptor.h" to "desc.h" and it worked.
GCC is kinda weird I think.
Curufir

Re:gcc -- header file not found! >:(

Post 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
Chris Giese

Re:gcc -- header file not found! >:(

Post by Chris Giese »

gcc -nostartfiles -nostdlib -fno-builtin -fwritable-strings -I source -c source/*.c
Tim

Re:gcc -- header file not found! >:(

Post by Tim »

Are you using DJGPP? It could be having problems with long file names. I'd recommend switching to Cygwin or Mingw.
petrusss

Re:gcc -- header file not found! >:(

Post by petrusss »

Yup, DJGPP (easy to install;))
Tim

Re:gcc -- header file not found! >:(

Post 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.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:gcc -- header file not found! >:(

Post by Solar »

...and giving you lots of other nifty tools in the process. (astyle, grep, gpg, ssh, irc, ...)
Every good solution is obvious once you've found it.
Post Reply