跳转到主要内容

Xilinx Vitis 2020.1添加include头文件包含路径的方法

judy 提交于

作者:巨大八爪鱼,文章来源:<span id="profileBt"><a href="https://blog.csdn.net/ZLK1214/article/details/122377753?spm=1001.2014.3…博客</a></span>

如图所示, 源文件目录中haha文件夹下有一个hoho.h头文件。本来要包含这个头文件应该写成#include "haha/hoho.h"的,但是如果写成#include <hoho.h>的话,就需要把haha文件夹添加到include头文件包含路径中,否则编译不通过。
<center><img src="http://xilinx.eetrend.com/files/2022-02/%E5%8D%9A%E5%AE%A2/100557766-24…; alt=""></center>

在左栏“项目名_system”的下一级“项目名”上点击右键,选择Properties命令。请注意是在下图红框处点击右键,而不是绿框处。
<center><img src="http://xilinx.eetrend.com/files/2022-02/%E5%8D%9A%E5%AE%A2/100557766-24…; alt=""></center>

找到C/C++ General --> Paths and Symbols,在右边的Includes选项卡上点击Add按钮:
<center><img src="http://xilinx.eetrend.com/files/2022-02/%E5%8D%9A%E5%AE%A2/100557766-24…; alt=""></center>

点击Workspace按钮:
<center><img src="http://xilinx.eetrend.com/files/2022-02/%E5%8D%9A%E5%AE%A2/100557766-24…; alt=""></center>

选择haha文件夹:
<center><img src="http://xilinx.eetrend.com/files/2022-02/%E5%8D%9A%E5%AE%A2/100557766-24…; alt=""></center>

点击OK:
<center><img src="http://xilinx.eetrend.com/files/2022-02/%E5%8D%9A%E5%AE%A2/100557766-24…; alt=""></center>

点击Apply and Close:
<center><img src="http://xilinx.eetrend.com/files/2022-02/%E5%8D%9A%E5%AE%A2/100557766-24…; alt=""></center>

现在就能编译通过了:
<center><img src="http://xilinx.eetrend.com/files/2022-02/%E5%8D%9A%E5%AE%A2/100557766-24…; alt=""></center>