Creating a cpp project in xcode on macos

Материал из Wiki - Факультет компьютерных наук
Перейти к: навигация, поиск
  1. Open Xcode
  2. In the Xcode welcome window choose “Create a new Xcode project”

Creating a C++ project in Xcode 1.png

  1. In the new window choose macOSCommand Line Tool and click “Next”

Creating a C++ project in Xcode 2.png

  1. Choose a project name. The organisation identifier doesn’t matter, write a funny word. Change the language to C++.

Creating a C++ project in Xcode 3.png

  1. Click “Next” and choose where to save the project
  2. Uncheck “Create Git repository on my Mac”. I’m almost certain you won’t need it.

Creating a C++ project in Xcode 4.png

  1. Choose main.cpp from the side bar. This is where you write your code.

Creating a C++ project in Xcode 5.png

  1. Compile and run your project by clicking the “Run” (▸) button
  2. A bottom panel should show up but it doesn’t have the program output. Click the “Show the Console” button in the bottom right.

Creating a C++ project in Xcode 6.png

  1. You should now see “Hello, World!” Printed in the console.

Creating a C++ project in Xcode 7.png