如何在 Xcode 4 中设置 C++ 项目?

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

How do I set up a C++ project in Xcode 4?

c++xcode4osx-snow-leopard

提问by mrswmmr

This probably has a really obvious answer, but I can't seem to find it. I am trying to use Xcode 4 to program with C++, and I want to create a project, build, and run it through Xcode 4 like I do for other languages. My problem is that I can't find the right type of project to do this.

这可能有一个非常明显的答案,但我似乎找不到。我正在尝试使用 Xcode 4 使用 C++ 进行编程,并且我想像其他语言一样通过 Xcode 4 创建项目、构建和运行它。我的问题是我找不到合适的项目类型来做到这一点。

回答by Ricky Bobby

Check this out : http://www.youtube.com/watch?v=Ey8LK7P1K94at 2:30 he creates a C++ project.

看看这个:http: //www.youtube.com/watch?v=Ey8LK7P1K94 在 2:30 他创建了一个 C++ 项目。

Or try this:

或者试试这个:

  1. Open XCode.
  2. File/New Project...
  3. In the "New Project" Assistant, expand the "Command Line Utility" group.
  4. Select "C++ Tool"
  5. Click "Next"
  6. Give a project name and directory, then click "Finish".
  7. Press Cmd-Shift-R to open the Console window. Output will appear there.
  8. Click the "Build and Go" toolbar button.
  1. 打开 XCode。
  2. 文件/新项目...
  3. 在“新建项目”助手中,展开“命令行实用程序”组。
  4. 选择“C++工具”
  5. 点击下一步”
  6. 给出项目名称和目录,然后单击“完成”。
  7. 按 Cmd-Shift-R 打开控制台窗口。输出将出现在那里。
  8. 单击“Build and Go”工具栏按钮。

回答by Nick Coelius

If you click around in the Mac OS part of New Project, there are a couple of options that I can see with a brief glance. Under Framework & Library there is an STL C++ Library you can access, and then under System Plug-in there's a barebones c++ plug-in you can use.

如果您在 New Project 的 Mac OS 部分中单击一下,我可以简要地看到几个选项。在 Framework & Library 下有一个您可以访问的 STL C++ Library,然后在 System Plug-in 下有一个您可以使用的准系统 c++ 插件。

Is that what you mean, or am I misinterpreting the question?

这是你的意思,还是我误解了这个问题?