Xcode and C++

I'm trying to learn C++ using Xcode and I'm only interested in crunching numbers for my ow amusement. I'm not developing anything for consumption yet. What I'd like to do it have the ability to run the object code created by the C++ compiler without loading Xcode and running it from there. In short, I just want an icon that I can click. Is this possible?

Replies

The short anwser is "Yes, you can." But, what do you want to do when you click on the icon? How are you planning on providing input? Where is the output going? You could write a command-line tool that can be run from the Terminal, and you can build an macOS application based on the command line tool, but, how to do it is all in the details of what you want to happen.

The following should work.


Compile the project.

Then, in the file list on the left of XCode, you will get a Products folder, with your app inside.

Option drag this file to the desktop

You'll get a copy there that you can double click or copy to another Mac.