There are many different tools you'll be able to use to make typical
applications on Mac but the one that we are visiting recommend is Xcode.
Xcode is a concept written by Apple it is not regrettable it will be
slow on large projects as an example we use Xcode over at EA to make
games for iOS and a few of the compile times of upwards of 20 minute to
games like Mesa speed, no limits it is also a nightmare to truly write
code because everything is lagging like hell when you've a project that
giant. However small projects like this and to be told C++ Xcode is
perhaps the simplest idea. So let's plow ahead and install it..
On your Mac we're going to go to the App Store we're going to type in Xcode and then we're going to install it and of course this will take some time depending on how fast your internet is. Once execute is installed let's go ahead and open it. We'll accept all the terms and conditions. Xcode is going to go ahead and install some components for us.
Once that's done we're going to create a new Xcode project for the template we're just going to click on mac OS and then choose command line tool. We'll give it a name. So hello world in this case and then under the language we're going to select C++. You'll have to put in some kind of organization identifier like .com.your company's the suggested one. So you can do something like .com whatever domain name you own. It doesn't really matter this is just supposed to be some kind of unique identifier it doesn't really matter what it is just put something in there and hit next then you're going to want to select a location for this.
Better to store things inside your user directory and then in a folder called dev. So make a folder called dev and then just click create. There we go Xcode would like to access your contact we don't really need that for this. This is basically what an Xcode project looks like there's a few project settings that you'll find inside the actual name. You click on the actual name of the project you've got all these build settings and build phases for the most part. We don't really need to touch anything so you'll see that we've all what we've already got a main.cpp file and we've already got a bunch of code but we are going to type it out again just so that it matches the other series article so basically we wanted to write
#include <iostream>
int main();
{
std::cout << "Hello world!" << std::endl ;
std::cin.get();
}
save that and then all you have to do to actually build it is you can hit product and then build. Now compile it. Build succeeded and then if you want to run it you can just hit play button that will also build it. You'll have to enable developer mode if this is your first time running Xcode. So the build succeeded and you should see a console pop out in the bottom here with your output what does he enter and you can see the program terminates successfully and that's it we're ready to learn C++ on Mac alright you've got Xcode up and running. That's pretty much the key to writing it.
No comments:
Post a Comment