Reputation: 177
I'm trying to compile a program with gcc, but I keep getting an error that it can't find the files I've specified to include. My code (a simplified version of what I'm trying to do which highlights the issue):
#include <gtk/gtk.h>
int main(int argc, char *argv[]) {
}
I'm compiling with gcc, using:
gcc test.c -I~/gtk/inst/include/gtk-2.0
which gives me
test.c:1:21: error: gtk/gtk.h: No such file or directory
However,
ls ~/gtk/inst/include/gtk-2.0/gtk | grep gtk.h
returns
gtk.h
gtkcheckbutton.h
gtkcheckmenuitem.h
gtkshow.h
so I'm not sure where I'm messing up. My OS is Mac OSX 10.8.5, and GCC is version 4.2.1.
Upvotes: 0
Views: 64
Reputation: 47284
You should either:
-I ~/gtk/inst/include/gtk-2.0
-I /users/username/gtk/inst/include/gtk-2.0
$HOME
:-I $HOME/gtk/inst/include/gtk-2.0
Shell only does tilde expansion if the ~
is the first nonquoted character in a word. The way you've got it now, shell has no clue that this is trying to point to the users home directory.
Upvotes: 1