我在示例文件中有以下代码:
#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"
Run Code Online (Sandbox Code Playgroud)
但是,此代码位于/ home/me/development/skia中的各种文件夹中(其中包括core/animator/images/ports/svg /等等).
如何让GCC认识到这条道路?
小智 25
该-I指令完成了这项工作:
gcc -Icore -Ianimator -Iimages -Ianother_dir -Iyet_another_dir my_file.c
Run Code Online (Sandbox Code Playgroud)
当您不控制构建脚本/过程时,使用环境变量有时会更方便。
对于 C 包括使用C_INCLUDE_PATH.
对于 C++ 包括使用CPLUS_INCLUDE_PATH.
有关其他 gcc 环境变量,请参阅此链接。
# `pip install` will automatically run `gcc` using parameters
# specified in the `asyncpg` package (that I do not control)
C_INCLUDE_PATH=/home/scott/.pyenv/versions/3.7.9/include/python3.7m pip install asyncpg
Run Code Online (Sandbox Code Playgroud)
set C_INCLUDE_PATH="C:\Users\Scott\.pyenv\versions\3.7.9\include\python3.7m"
pip install asyncpg
# clear the environment variable so it doesn't affect other builds
set C_INCLUDE_PATH=
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
127081 次 |
| 最近记录: |