Xcode 4菜单“Build”和“清洁”选项已禁用 [英] Xcode 4 menu "Build" and "Clean" options disabled

查看:216
本文介绍了Xcode 4菜单“Build”和“清洁”选项已禁用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些c ++ Xcode 3项目,我需要移动到Xcode 4.我做了这一点,只需重命名Xcode 3文件夹,加载Xcode 3项目在Xcode 4,然后击中现代化按钮。在其中一些项目的情况下,我不能构建它们,因为Xcode 4Build和Clean菜单选项被禁用(它们都是静态库,所以没有运行它们的问题)。我已经将一些移植的Xcode 4项目添加到Xcode 4工作区中,作为构建整个工作区内容的一部分。不管怎样,我也可能需要独立地构建这些项目。任何想法?

I have a few c++ Xcode 3 projects which I need to move to Xcode 4. I have done this by simply renaming the Xcode 3 folder, loading the Xcode 3 project in Xcode 4 and then hitting the modernize button. In the case of some of these projects I cannot build them because the Xcode 4 "Build" and "Clean" menu options are disabled (they are all static libraries so there is no question of running them). I have added some of these ported Xcode 4 projects into an Xcode 4 workspace where they build fine as part of building the entire workspace contents. None the less I will probably need to build these projects independently as well. Any ideas?

感谢,

Barrie

推荐答案

在Xcode 4.2加载到Xcode 3.2时,我遇到了同样的问题。什么解决它为我改变方案,Xcode 4.2为项目设置。他们似乎解读设置文件有点不同。

I was getting the same problem with an Xcode 3.2 project when loaded into Xcode 4.2. What solved it for me was changing the "Schemes", which is Xcode 4.2 for "Project Settings." They seem to interpret the settings files a bit differently.

转到菜单:产品 - >编辑方案。注意,在新对话框顶部的下拉菜单中选择了哪个库。您可能需要对每个库进行此更改。 Mine默认为所有框选中&我离开了。

Go to Menu: Product -> Edit Schemes. Note which library is selected in the pulldown menu along the top of the new dialog. You'll probably need make this change for each library. Mine defaulted to all boxes checked & I left it like that.

点击查看Scheme生成面板

在左侧列中展开Build块。从预处理,构建,后操作中选择构建。现在在右边的大块,你会看到一个建立目标(可能是红色,我的所有)。

Along the left column, expand the "Build" block. Select "Build" from Pre-Actions, Build, Post-Actions. Now in the larger right block, you'll see a build target (possibly in red, mine all were).

点击底部的+按钮块;它应该列出目标清单。选择您要为此库构建的一个,然后单击添加。现在,您可以选择旧的无效目标,然后单击底部的 - 按钮将其删除。单击确定。

Click the "+" button at the bottom of this block; it should bring up a list of targets. Select the one you want to build for this library and click "Add". Now you can select the old invalid target and click the "-" button at the bottom to remove it. Click "OK".

修复这些目标之一后,当固定库被选择为当前方案时,Build和Clean

After fixing one of these targets, "Build" and "Clean" should become enabled when that fixed library is selected as your current scheme in the upper-left of the main window.

如果您有一个主项目,您希望每个子项目都设置为主项目的依赖项。

If you have a master project, you want each sub-project set up as a dependency of the master project too. Xcode 4.2 also missed this from the Xcode 3.2 project.

在主窗口中,打开Project Navigator(左边最左边的图标)并选择您的主项目。在右侧,选择目标。在右边,在顶部选择构建阶段。你应该得到一个下面的列表您当前的依赖。再次点击底部的+按钮添加每个项目的目标。

On the main window, bring up the Project Navigator (leftmost icon above left column) and select your master project. To the right, select the target. To the right of that, on the top select "Build Phases." You should get a list below that for your current dependencies. Click the "+" button at the bottom again to add the targets from each project.

点击查看目标依赖关系对话框

这篇关于Xcode 4菜单“Build”和“清洁”选项已禁用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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