clang_complete:Vim自动完成iOS [英] clang_complete: Vim autocompletion for iOS

查看:239
本文介绍了clang_complete:Vim自动完成iOS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以最近我一直在试图建立一个基于Vim的iOS工作流程。

So recently I have been trying to set up a Vim-based iOS workflow.

我发现clang_complete,并设置clang用户选项在我的.vimrc喜欢因此

I found clang_complete, and have set the clang user options in my .vimrc like so

let g:clang_user_options='-fblocks -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -D__IPHONE_OS_VERSION_MIN_REQUIRED=40300'

,如下所示: http://www.zenskg.net/wordpress/?p=199#comment-229

并添加了一些框架/头/ lib路径。我不会张贴整条线,因为它是巨大的。

and added a few framework/header/lib paths. I'm not going to post the whole line because it is huge.

所以我在命令行中使用 clang 测试项目中其中一个文件的编译如果我使用 -arch armv6 / 7 标志,它会编译正确,但只有 。如果我不是它试图编译为i386和抱怨丢失的头文件。

So I tested the compilation of one of the files in my project using clang from the command line (using the same options), and it compiles fine, but only if I use the -arch armv6/7 flag. If I don't it tries to compile for i386 and complains of missing header files.

到目前为止这么好。现在我只是使用我给予 clang clang_complete 的用户选项完全相同的选项$ c> .vimrc 对不对?

So far so good. Now I just use the exact same options I gave to clang, to clang_complete's user options in my .vimrc right?

当我这样做,并试图自动完成一个词在Vim,它说

Nope. When I do that and try to autocomplete a word in Vim, it says

 unknown argument: '-arch' 

。我需要这个标志 - 我该怎么进行?

in the QuickFix list of Vim. I kinda need this flag- how should I proceed?

任何想法有用。

推荐答案

clang_complete runs clang -cc1 ,这导致编译器前端运行,而不是驱动程序。编译器前端不理解 -arch 选项。 clang -cc1 --help 将显示可能的选项。您应该指定 -triple -target - * 之一。

clang_complete runs clang -cc1, which causes the compiler front-end to run and not the driver. The compiler front-end doesn't understand the -arch option. clang -cc1 --help will show you the possible options. You should probably specify -triple or one of -target-*.

如果您不确定要使用什么,您可以像之前一样手动运行clang,但在详细模式( -v )。这样,它将打印 clang -cc1 命令行,您可以在其中找到相应的参数。

If you're not sure what to use, you can run clang manually as you did, but in verbose mode (-v). This way it will print the clang -cc1 command line, where you can find the appropriate arguments.

这篇关于clang_complete:Vim自动完成iOS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆