{"id":5530,"date":"2013-12-11T05:02:39","date_gmt":"2013-12-10T18:02:39","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=5530"},"modified":"2016-12-03T09:46:30","modified_gmt":"2016-12-02T23:46:30","slug":"c-c-netbeans-xcode-gcc-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/c-c-netbeans-xcode-gcc-primer-tutorial\/","title":{"rendered":"C, C++ NetBeans, Xcode gcc Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/NetBeans\/\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"C, C++ NetBeans, Xcode gcc Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/Mac\/NetBeans\/NetBeans_c_gcc-158of.jpg\" title=\"C, C++ NetBeans, Xcode gcc Primer Tutorial\"  \/><\/a><p class=\"wp-caption-text\">C, C++ NetBeans, Xcode gcc Primer Tutorial<\/p><\/div>\n<p>Today&#8217;s tutorial has come about as a consequence of <a target=_blank title='Xcode and its Command Line Tools Primer Tutorial' href='#xaicltpt'>Xcode and its Command Line Tools Primer Tutorial<\/a> in the sense that the installation of Xcode Command Line Tools (in earlier Xcode versions &#8230; think maybe less than 4 &#8230; &#8220;out of the box&#8221; it lived with C and C++&#8217;s great gcc compiler &#8230; have talked about this before &#8230; <a target=_blank title='rave' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=4844#hfafodm'>raved<\/a> perhaps??!!! &#8230; anyway &#8230; that went away with the later versions &#8230; but you can get it back) <i>&#8220;closes the circle&#8221;<\/i> 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 &#8230; cute, huh?<\/p>\n<p>Today&#8217;s tutorial helps in another way, in that you get a C makefile out of it.  Steve Winwood sang <a target=_blank title='While You See a Chance, Take It' href='http:\/\/www.youtube.com\/watch?v=0j6g_uUhH2c'><i>&#8220;While You See A Chance Take It&#8221;<\/i><\/a>, and that is something <a target=_blank title='makefile opportunity' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=4844#makefile'>apt<\/a> here.   Build on something <i>simple<\/i> and working and today&#8217;s NetBeans\/gcc makefile is for a simple <i>Hello World<\/i> program.   This is why programmer&#8217;s use <i>Hello World<\/i> so much &#8230; it is simple &#8230; build on <i>&#8220;simple&#8221;<\/i>.<\/p>\n<p><p>Link to downloadable NetBeans C makefile (for <a target=_blank title='main.c' href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/NetBeans\/main.c_GETME\">main.c<\/a>) configuration file you can rename to <a target=_blank title='Makefile' href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/NetBeans\/Makefile.GETME\">Makefile<\/a> (the parent) and its children <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/NetBeans\/Makefile-Debug.mk_GETME\" title='Makefile-Debug.mk' >Makefile-Debug.mk<\/a>, <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/NetBeans\/Makefile-impl.mk_GETME\" title='Makefile-impl.mk' >Makefile-impl.mk<\/a>, <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/NetBeans\/Makefile-Release.mk_GETME\" title='Makefile-Release.mk' >Makefile-Release.mk<\/a>, <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/NetBeans\/Makefile-variables.mk_GETME\" title='Makefile-variables.mk' >Makefile-variables.mk<\/a><\/p>\n<p>Hope you enjoy this tutorial (and if necessary consult the <a target=_blank title='Tutorial picture' href='http:\/\/www.rjmprogramming.com.au\/Mac\/NetBeans\/NetBeans_c_gcc-158of.jpg'>tutorial picture<\/a> for more context) and the previous relevant C++ one called <a target=_blank title='C++ Xcode OOP Exceptions Primer Tutorial' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=4334'>C++ Xcode OOP Exceptions Primer Tutorial<\/a>.<\/p>\n<hr \/>\n<p id='xaicltpt'>Previous relevant <a target=_blank title='Xcode and its Command Line Tools Primer Tutorial' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=5530'>Xcode and its Command Line Tools Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/Xcode\/Xcode_command_line_tools.jpg\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Xcode and its Command Line Tools Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/Mac\/Xcode\/Xcode_command_line_tools.jpg\" title=\"Xcode and its Command Line Tools Primer Tutorial\"  \/><\/a><p class=\"wp-caption-text\">Xcode and its Command Line Tools Primer Tutorial<\/p><\/div>\n<p>Xcode is a great GUI IDE application that comes with Macs &#8220;out of the box&#8221; (quite often).  In the earlier versions &#8230; think maybe less than 4 &#8230; &#8220;out of the box&#8221; it lived with C and C++&#8217;s great gcc compiler &#8230; have talked about this before &#8230; <a target=_blank title='rave' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=4844#hfafodm'>raved<\/a> perhaps??!!! &#8230; anyway &#8230; that went away with the later versions &#8230; 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&#8217;t already.<\/p>\n<p>Remember at the end of the month to say &#8220;hares&#8221; as your last word and &#8220;rabbits&#8221; as the first word of the next month.<\/p>\n<p><p>Do we need to explain?<\/p>\n<p>Butterflies in Brazil and all &#8230; why buck what the whole world&#8217;s doing? &#8230; chortle, chortle.<\/p>\n<p>Anyway, this action opens a pandora&#8217;s box of possibilities with your Mac, and hope if you are in this position &#8230; you can test if you are by attempting to go <i>gcc<\/i> at the Mac Terminal bash command line &#8230; how&#8217;s the coffee? (if PM, how&#8217;s the daquiri?)<\/p>\n<p>To get started, visit this stupendous <a target=_blank title='Xcode command line tools link' href='http:\/\/stackoverflow.com\/questions\/9329243\/xcode-4-4-and-later-install-command-line-tools'>link<\/a>.   Then get into Xcode and go to Xcode->Preferences&#8230;->Downloads (and hopefully you see the Command Line Tools install button to press &#8230; press with both hands, either hand, while doing a triple pike, but &#8230; just &#8230; do &#8230; it!)<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d5519' onclick='var dv=document.getElementById(\"d5519\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?cat=15\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d5519' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr \/>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d5530' onclick='var dv=document.getElementById(\"d5530\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=NetBeans\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d5530' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Today&#8217;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 &#8230; think maybe less than 4 &#8230; &#8220;out &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/c-c-netbeans-xcode-gcc-primer-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,24,33,37,40],"tags":[176,249,478,505,585,723,833,997,1166,1473],"class_list":["post-5530","post","type-post","status-publish","format-standard","hentry","category-elearning","category-netbeans","category-software","category-tutorials","category-xcode","tag-c","tag-configuration","tag-gcc","tag-gnu","tag-ide","tag-mac","tag-netbeans","tag-programming","tag-software-2","tag-xcode"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/5530"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=5530"}],"version-history":[{"count":1,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/5530\/revisions"}],"predecessor-version":[{"id":26718,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/5530\/revisions\/26718"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=5530"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=5530"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=5530"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}