Can Xcode be used as c++ compiler?
I am wanting to start to do some c++ programming. Does Xcode have to facilities to be able to write basic code and compile it?if so, how do you create a blank project and then compile?
MacBook Pro
You can make a difference in the Apple Support Community!
When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.
When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.
I am wanting to start to do some c++ programming. Does Xcode have to facilities to be able to write basic code and compile it?if so, how do you create a blank project and then compile?
MacBook Pro
Yes
Xcode > File > New > Project > Command Line Tool > Next > Language -> C++
You can also freely add C++ files to any other kind of project too. If you do that, you would be responsible for jumping through the linking hoops.
Yes
Xcode > File > New > Project > Command Line Tool > Next > Language -> C++
You can also freely add C++ files to any other kind of project too. If you do that, you would be responsible for jumping through the linking hoops.
Thank you etresoft. I know this may sound like a real rookie question, but once the program is compiled with no errors, how do you get it to run bringing up the black "cli" screen?
Click the "run" arrow in the upper left corner of the window.
Thank you again. I just have one other question, if you don't mind. I have previously used c++ on PC and I'm now using it on mac. On the PC, it would bring up a cli dos screen to run the programs in, allowing you to build menus to choose from. Is it possible to do this through Xcode?
I'm sorry. I don't know what you are asking. "build menus to choose from?"
Xcode is optimized for building apps, not doubt about it. If you want to build programs entirely on the command line, you can still do that with the command line tools. If you build from within the Xcode debug environment, you have to interact via the little debug window. It works fine for the most part. You can run a built program directly in the command line but you would probably have to "archive" it first to export it out of the Xcode environment.
If you are still learning, I strongly suggest just using the command line. You could use Xcode as just a text editor, although it isn't particularly good at that. There are many other text editors available. TextWrangler is a popular one. Again, if you are learning, then vi is a good skill to learn. Once you get more than one source file, you may want to start writing makefiles. If things get really complicated, then you probably want to go back to Xcode, but then you are back at square one with Xcode's convoluted environment.
Unfortunately, Apple makes no allowances for people trying to learn, especially something like C++. If you want to do everything the "Apple way" then you would use the Swift Playground. But if you want C++, then Apple is just going to kick you back to 1994.
TThanks
nuttsy_5 wrote:
TThanks
Gotta love that iPad stutter 🙂
Can Xcode be used as c++ compiler?