gpt4 book ai didi

C++ 本地库和相对路径

转载 作者:太空宇宙 更新时间:2023-11-04 03:32:42 25 4
gpt4 key购买 nike

我的应用程序中有很多这样的包含

#include "../../libs/helper.hpp"

我很高兴在那里删除 ../../libs/从每一个包括。有什么办法可以解决这个问题,这样我就可以这样调用库了吗?

#include "helper.hpp"

一种可能的方法是使用 -I在 make 文件中切换。但问题是我应该使用尖括号 <>用于调用库。这是不可取的,因为我更喜欢区分我的本地库和已安装的库。所以我正在寻找一种方法来调用它 "围绕库的名称。

有什么办法吗?

最佳答案

-iquotedir
Add the directory dir to the head of the list of directories to be searched for header files only for the case of #include "file"; they are not searched for #include <file>, otherwise just like -I.

https://gcc.gnu.org/onlinedocs/gcc-5.3.0/gcc/Directory-Options.html#Directory-Options

关于C++ 本地库和相对路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35010222/

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