Newb Programming Question

Joined
May 11, 2011
Messages
4
Reaction score
0
Points
1
Im new to Programing, and even newer to Macs and X Code, and I just have a quick question. I know when I write code in Bloodshed Dev C++, when its time to compile, it actually creates a clickable .exe file on my computer to run the program that's been created.

What is the equivalent to this on XCode? I expected a clickable file on the desktop on my Mac but it's not there. Or do I need to specifically configure XCode to create such a clickable file when my program is compiled? Bear in mind that the only programs I've written for either thus far is the Hello World, in case that makes a difference.

Thanks in advanced!
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
You don't create clickable executables - they have to be run from the command line (assuming you're making a command line application). Either run it from Xcode or use the terminal in /Applications/Utilities. Are you familiar with the command line interface?
 
OP
O
Joined
May 11, 2011
Messages
4
Reaction score
0
Points
1
No but I will take a look at it. Thanks for pointing me in the right direction!
 
Joined
Aug 17, 2010
Messages
247
Reaction score
8
Points
18
Your Mac's Specs
2011 Mac mini and 2010 13" MacBook Pro, iPhone 4 and iPad
When you start Xcode you have an option to choose a c++ project using the command line tool. From there it starts you out with a main.cpp file that you can rename and edit to fill in whatever code you want to run. the main.cpp file in there is actually a hello world example lol. Anyway, once you double click on the main.cpp and edit it you just need to save and there will be a button that says build and run that compiles and runs the program you just wrote. To view the program and interact (i.e. input info for user inputs) you will need to view the console, which is under menu option Run>Console, also command, shift R I think. This will pull up the window where Xcode runs the program and you will be able to watch it do whatever it does. I just installed Xcode this week myself and I'm sure there are some other more detailed directions but thats where I'm at so far. Hope this helps :)
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top