xcode 在标题搜索路径中选中“递归”是什么意思

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11600782/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 00:58:43  来源:igfitidea点击:

What does it mean when you check on "Recursive" in Header Search Paths

xcodexcode4xcode4.2

提问by Vincent Bacalso

I've been referencing a lot of Projects, and i do it through adding their paths in Header Search Paths.

我一直在参考很多项目,我通过在标题搜索路径中添加它们的路径来做到这一点。

I've been following the referencing stuffs through the "Referenced Project's" getting Started (like for example including the ZXingWidget).

我一直在通过“参考项目”入门(例如包括 ZXingWidget)来关注参考资料

And I've been doing it a lot now, but I don't understand the checking of recursive.

而且我现在已经做了很多,但我不明白递归的检查。

  1. What does this mean?
  2. When do I check a path for "recursive?"
  1. 这是什么意思?
  2. 我什么时候检查“递归”的路径?

Thanks

谢谢

采纳答案by Almo

If you give Xcode a path to use for headers, it will check that path when you use an #includeor #importstatement. If the file isn't there, it quits.

如果你给 Xcode 一个用于标题的路径,它会在你使用#includeor#import语句时检查该路径。如果文件不存在,它会退出。

If you have the path set as "recursive", Xcode will search folders it finds there if it doesn't find the file.

如果您将路径设置为“递归”,Xcode 将搜索它在那里找到的文件夹,如果它没有找到该文件。

Looks like this:

看起来像这样:

enter image description here

在此处输入图片说明

回答by user2460799

1) Enter your desired path for Header Search Paths, click enter.

1) 为标题搜索路径输入您想要的路径,点击回车。

2) Double click the path text that you entered.

2) 双击您输入的路径文本。

3) On the right of the dialog box select recursive.

3) 在对话框的右边选择递归。

回答by Perry

For those wondering, as I was, what the effect of choosing recursivefor a Header Search Pathis on the compiler command line, it's to generate a -Iargument for every directory in the tree rooted at the given path. This can lead to very long compiler command lines which will make looking for anything else in there well nigh impossible. So it's worth considering how many directories are below the path you are specifying if you want to use recursive.

对于那些想知道,因为我是,选择的效果什么recursive头文件搜索路径是在编译器命令行上,这是生成一个-I用于参数在给定的路径根的树的每个目录。这会导致编译器命令行非常长,这将使在其中查找任何其他内容几乎不可能。因此,如果要使用recursive.

I tried specifying -I../path/to/subproject/**as a Compiler Flagfor an individual file but that doesn't work (which is obviously why Xcode does the expansion itself).

我尝试将单个文件指定-I../path/to/subproject/**编译器标志,但这不起作用(这显然是 Xcode 自己进行扩展的原因)。

(this is true for Xcode 9.4.1)

(这适用于 Xcode 9.4.1)

回答by yoAlex5

When you set a path(e.g. Header Search Paths, Library Search Paths, Framework Search Paths...) you can define a path to one of parent folder and set recursive(/**will be added to the end of the path). For example you can defile a pathto a includedirectory(or more over to a Builddirectory) with recursiveparameter instead of include/<target_name>.

当您设置path(例如Header Search PathsLibrary Search PathsFramework Search Paths...),您可以定义一个路径父文件夹和设置的一个recursive/**将被添加到路径的末尾)。例如,您可以污秽pathinclude目录(或更多转移到Build目录)与recursive参数代替include/<target_name>

Please note: If the patchcontains spaces - , you should escape them using \or enclose the path in double quotes ""

请注意:如果patch包含空格 - ,您应该使用\双引号将它们转义或将路径括起来""