tags:

views:

79

answers:

4

Once again, GCC is making me feel like an idiot for having trouble with the simplest things. I've included a header:

#include "PDL.h"

Then, I try to compile:

arm-none-linux-gnueabi-gcc -I/cygdrive/c/PalmPDK/include -I../lua-5.1.4/lua-webos/include -O2 -Wall -shared -nostdlib -mcpu=arm1136jf-s -mfpu=vfp -mfloat-abi=softfp -lpdl

But it says:

PDL.h: no such file or directory

I can change into the include directory I specified above and see PDL.h is there, but GCC just doesn't see it.

A: 
bta
I tried using brackets, but it didn't change the output. I also have other search directories specified with `-I` whose headers are included with quotes and they work just fine. This only happens with headers in `/cygdrive/c/PalmPDK/include`. Which would lead me to believe it's a typo or something, but I can change to that directory and see PDL.h exists.
David Brown
"file.h" must use the <file.h> algorithm if the file isn't found before.
AProgrammer
gcc searches for "..." includes in -I directories just fine. Even with -I- all -I options will be searched for local includes. Are you talking about something weird and specific to this cross compiler?
Owen S.
@Owen- Re-reading the gcc docs I see that you are correct. I think I am using a non-conforming gcc implementation (which would explain a couple of other things...). I should fix that.
bta
A: 

If you have spaces in the path you'll need to escape them or surround the path with double quotes.

Jay
There are no spaces in the path (which I included in my question).
David Brown
A: 

Assuming you're on a Linux box, or some flavor of Unix:

ls -l /
ls -l /cygdrive
ls -l /cygdrive/c
ls -l /cygdrive/c/PalmPDK
ls -l /cygdrive/c/PalmPDK/include

You will probably find your answer in the results of one of the commands listed above.

John R. Strohm
All of those commands succeeded and the last one displayed PDL.h. Like I said, a typo would make sense, but I've checked and rechecked.
David Brown
+4  A: 

/cygdrive is something specific to cygwin, so if gcc isn't compiled to use the cygwin unix emulation layer, it won't search it. Try using -IC:/PalmPDK/include.

AProgrammer