运行目标对于运行方案 Xcode 无效

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/33094641/
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 08:02:12  来源:igfitidea点击:

Run Destination Not Valid For Running Scheme Xcode

c++cxcodeide

提问by timtour97

Just downloaded Xcode and I am trying to run a simple C++ file to make sure everything works and whenever I try to run the .cpp file I am given this: "The run destination My Mac is not valid for Running the scheme 'Scheme_Name'.

刚刚下载了 Xcode,我正在尝试运行一个简单的 C++ 文件以确保一切正常,每当我尝试运行 .cpp 文件时,我都会得到以下信息:“运行目标我的 Mac 对运行方案‘Scheme_Name’无效。

回答by maggix

happened the same to me with a project I downloaded. In my case, the solution was to change the "Base SDK" to the latest OS X in the Build Settings.

我下载的一个项目也发生了同样的事情。就我而言,解决方案是在 Build Settings 中将“Base SDK”更改为最新的 OS X。

To do so, click on the project name in the navigator on the left, then on Build Settingsand in the main window you should look for Base SDK.

为此,请单击左侧导航器中的项目名称,然后在Build Settings主窗口中查找Base SDK.

If Base SDKdoes not show, ensure that "All" is selected in the filter at the top of the page.

如果Base SDK未显示,请确保在页面顶部的过滤器中选择了“全部”。

Base SDK set to 10.10 in this example

Base SDK set to 10.10 in this example

回答by winner.ktw

In my case, I had the same issue when I duplicated and renamed a project. I solved by setting the Build Target in the Scheme Edit view. enter image description here

就我而言,当我复制和重命名一个项目时,我遇到了同样的问题。我通过在 Scheme Edit 视图中设置 Build Target 来解决。 enter image description here