c++ - 如何在 GCC 搜索路径中包含头文件?

我在示例文件中有以下代码:

#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"

但是,此代码位于/home/me/development/skia 内的多个文件夹中(其中包括 core/animator/images/ports/svg/等等。)

如何让 GCC 识别这条路径?

最佳答案

试试gcc -c -I/home/me/development/skia sample.c

https://stackoverflow.com/questions/973146/

相关文章:

c++ - 每个类都应该有一个虚拟析构函数吗?

c++ - 是否有用于检测 C++11x 支持的预处理器指令?

c++ - C中有const吗?

c++ - 使用 Qt 进行序列化

>' should be ` > >' within ">c++ - 模板内的模板 : why "` >>' should be ` > >' within

c++ - 如何遍历打包的可变参数模板参数列表?

c++ - 什么时候需要 "typename"关键字?

c++ - 复制 std::vector:更喜欢赋值还是 std::copy?

c++ - C++ 中的 vector ::size_type

c++ - C 样式字符串作为模板参数?