C, C++ NetBeans, Xcode gcc Primer Tutorial

C, C++ NetBeans, Xcode gcc Primer Tutorial

C, C++ NetBeans, Xcode gcc Primer Tutorial

Today’s tutorial has come about as a consequence of Xcode and its Command Line Tools Primer Tutorial in the sense that the installation of Xcode Command Line Tools (in earlier Xcode versions … think maybe less than 4 … “out of the box” it lived with C and C++’s great gcc compiler … have talked about this before … raved perhaps??!!! … anyway … that went away with the later versions … but you can get it back) “closes the circle” on the separation of C and C++, at least as far as NetBeans is concerned, so that we can use the installed Xcode Command Line Tool gcc compiler for C work and use the GNU compiler for C++ in NetBeans … cute, huh?

Today’s tutorial helps in another way, in that you get a C makefile out of it. Steve Winwood sang “While You See A Chance Take It”, and that is something apt here. Build on something simple and working and today’s NetBeans/gcc makefile is for a simple Hello World program. This is why programmer’s use Hello World so much … it is simple … build on “simple”.

Link to downloadable NetBeans C makefile (for main.c) configuration file you can rename to Makefile (the parent) and its children Makefile-Debug.mk, Makefile-impl.mk, Makefile-Release.mk, Makefile-variables.mk

Hope you enjoy this tutorial (and if necessary consult the tutorial picture for more context) and the previous relevant C++ one called C++ Xcode OOP Exceptions Primer Tutorial.


Previous relevant Xcode and its Command Line Tools Primer Tutorial is shown below.

Xcode and its Command Line Tools Primer Tutorial

Xcode and its Command Line Tools Primer Tutorial

Xcode is a great GUI IDE application that comes with Macs “out of the box” (quite often). In the earlier versions … think maybe less than 4 … “out of the box” it lived with C and C++’s great gcc compiler … have talked about this before … raved perhaps??!!! … anyway … that went away with the later versions … but you can get it back. Why bother? If you like to look around and do those great command line offerings like Tcl/Tk or just plain simple C (like we do in this tutorial), as well as leaving your Xcode GUI C++ and Objective-C iOS mobile development intact, then think you should install Xcode Command Line Tools, like, yesterday, if you haven’t already.

Remember at the end of the month to say “hares” as your last word and “rabbits” as the first word of the next month.

Do we need to explain?

Butterflies in Brazil and all … why buck what the whole world’s doing? … chortle, chortle.

Anyway, this action opens a pandora’s box of possibilities with your Mac, and hope if you are in this position … you can test if you are by attempting to go gcc at the Mac Terminal bash command line … how’s the coffee? (if PM, how’s the daquiri?)

To get started, visit this stupendous link. Then get into Xcode and go to Xcode->Preferences…->Downloads (and hopefully you see the Command Line Tools install button to press … press with both hands, either hand, while doing a triple pike, but … just … do … it!)

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

This entry was posted in eLearning, NetBeans, Software, Tutorials, Xcode and tagged , , , , , , , , , . Bookmark the permalink.

17 Responses to C, C++ NetBeans, Xcode gcc Primer Tutorial

Leave a Reply

Your email address will not be published. Required fields are marked *