如何解决GCC中的包含文件名冲突? [英] How to resolve include file names conflicts in GCC?
问题描述
在不同的库中,我有两个名为 string.h
的头文件,它们相互冲突,甚至与具有相同名称的标准C包含文件冲突。 p>
不需要使用任何 string.h
,但是我需要在GCC中包含库头文件路径搜索路径。目前我使用类似于 -I / usr / local / include / lib1 -I / usr / local / include / lib2
的东西,但是这样我不能包含标准C string.h
。
解决这种冲突的正确方法是什么?
> gcc -I / usr / local / include
。 I have two header files named string.h
in different libraries, they are conflicted with each other and even conflicted with standard C include file of the same name.
There is no need to use any string.h
except standard one, but I need to include libraries headers paths in GCC search path. Currently I use something like -I /usr/local/include/lib1 -I /usr/local/include/lib2
, but that way I can not include standard C string.h
.
What is the right way to resolve such conflicts?
You can probably use #include <lib1/string.h>
and compile with gcc -I/usr/local/include
.
这篇关于如何解决GCC中的包含文件名冲突?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!