gpt4 book ai didi

c++ - 如何在我的 "include path"中放入一些东西?

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:40:21 26 4
gpt4 key购买 nike

我的所有项目都包含在特定目录中的文件(在我的项目目录中称为 include)。当我将它们包含在 cpp 文件中时,我需要

#include "include/somefile.h"

我要怎么做才能做到

#include <somefile.h>

?

最佳答案

使用编译器的-I 标志。喜欢:

~$ c++ -Wall -Werror -pedantic -I/home/user/include -c source_file.cpp

关于c++ - 如何在我的 "include path"中放入一些东西?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4218357/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com