How to include header files in GCC search path?


Question

I have the following code in a sample file:

#include "SkCanvas.h"
#include "SkDevice.h"
#include "SkGLCanvas.h"
#include "SkGraphics.h"
#include "SkImageEncoder.h"
#include "SkPaint.h"
#include "SkPicture.h"
#include "SkStream.h"
#include "SkWindow.h"

However, this code is located in various folders within /home/me/development/skia (which includes core/ animator/ images/ ports/ svg/ and a lot more.)

How can I make GCC recognize this path?

1
49
11/8/2011 12:40:04 PM

Accepted Answer

Try gcc -c -I/home/me/development/skia sample.c. See here.

72
6/10/2009 12:25:42 AM

The -I directive does the job:

gcc -Icore -Ianimator -Iimages -Ianother_dir -Iyet_another_dir my_file.c 

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon