C++ code can be compiled by the LLVM compiler, which is built right into Xcode 8. This can be done by creating a command line tool app. See how the entire process works in this video.
- [Instructor] Xcode ships with a compiler called LLVM. This compiler can compile C, Objective-C, C++, and Swift. Let's see what it looks like creating a command line tool that uses C++. When you're creating your project, under macOS, choose Command Line Tool, and then click Next. I'll call this Product Name CompilerExample, and then choose for the Language, C++.
Now we've seen Swift and Objective-C for both macOS and iOS projects, but for a command line tool, we actually have the option to choose C++. So we'll choose that and hit Next. We're going to save this in Exercise Files Chapter 06, compiling, final. If you're following along as usual, just save it outside of that folder. So in my project, I have my C++ file, main.cpp. I can go into that file and write my C++ code.
I'll make a simple modification here, and run the app as usual by clicking the button or pressing command + r on the keyboard, and in the debug area, I'll see the appropriate output. So if you want to create a C++ command line tool, Xcode already has the templates for it, and it's compiled using the LLVM compiler.
Author
Released
11/18/2016These Xcode tutorials help new developers install Xcode and start writing and editing code. Instructor Todd Perkins shows how to build a brand-new user interface (UI) with buttons and menus in Interface Builder, Xcode's intuitive UI design tool, as well as advanced designs that adapt to screen size, aspect ratio, and orientation changes. He reviews the version control and storyboard features, as well as the basics of schemes and behaviors. Plus, learn how to compile and debug apps, test apps in the iOS Simulator, and send your app to Apple for distribution in the App Store.
- What is Xcode?
- Installing Xcode 8
- Creating your first Xcode project
- Editing code
- Creating snippets
- Adding Git version control
- Making interface connections to the code
- Using Interface Builder
- Creating storyboards
- Pinning objects
- Compiling code with the LLVM compiler
- Working with schemes and behaviors
- Sharing resources in a workspace
- Catching common errors with Analyze and Fix-It
- Using the iOS Simulator
- Preparing an app to be published
Skill Level Beginner
Duration
Views
-
Introduction
-
Welcome47s
-
-
1. Getting Started
-
What is Xcode?1m 57s
-
Install Xcode 840s
-
Explore the user interface4m 59s
-
Use tabs2m 2s
-
Open files quickly1m 9s
-
View the Xcode documentation2m 14s
-
Use the Quick Help inspector1m 52s
-
Import assets4m 57s
-
-
2. Edit Code
-
Create snippets4m 6s
-
Use the Symbol Navigator2m 48s
-
Prototype in a playground3m 44s
-
3. Version Control
-
Commit changes2m 34s
-
4. Interface Builder Basics
-
Explore Interface Builder5m 58s
-
Use the Identity Inspector5m 33s
-
Use the Attributes Inspector3m 55s
-
Use the Size Inspector2m 45s
-
-
5. Storyboards
-
Understanding pinning7m 16s
-
Modify pins3m 26s
-
6. Compiling
-
Work with schemes3m 1s
-
Use behaviors1m 51s
-
7. Debugging
-
Use the debugger3m 42s
-
Work with breakpoints3m 15s
-
-
8. Workspaces
-
Create a workspace4m 18s
-
-
9. Static Analysis Tools
-
Correct errors with Fix-it1m 54s
-
Use the Analyze tool1m 48s
-
-
10. The iOS Simulator
-
11. Publishing Apps
-
Send an app to Apple2m 40s
-
Conclusion
-
Next steps1m
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Compile C++ with the LLVM compiler