|Getting Started With C Using NetBeans|
|Written by Harry Fairhead|
|Monday, 13 June 2016|
Page 2 of 2
Using Tool Collections
If you encounter a problem with the Tool Collection at this point it is probably better to cancel the project creation and move to the Services window to examine the Tool Collections available.
You can see the Tool Collections that are locally installed and any that are installed on remote servers. Using a remote build server is a perfectly good way to learn C programming but a local Tool Collection is perhaps easier - see Remote C/C++ Development With NetBeans.
If you right click on a Tool Collection and select properties then the dialog box that appears tells you where each of the components of GCC and the make utility are located. If you know better then change the entries. More commonly if NetBeans has failed to automatically find any of the components it is up to you to supply their locations.
In the case or MinGW, if anything is missing the simplest option is to go back to the installer and try again. As long as you are using the correct version of MinGW, NetBeans should just work.
Creating a Hello World Program
If all of this is okay it is now time for the easy part - creating the Hello World program.
Go back to the projects tab, drop down the Source Files node in the Projects window and select main.c. This will open in the editor. Change the program to read:
In other words add
to the program. Now click the green arrow compile and run button or use Run, Run Project or press F6 and your program will be compiled and run. You will see the output in the Output window a the bottom of the screen. You will also see a lot of other messages scroll past before your program is run - what some of these mean will be explained in later parts.
If you have a working C compiler you are now ready and equipped to move on to the next stage and start learning some C.
Watch this space for the next installment.
Fundamental C: Getting Closer To The Machine
Now available as a paperback and ebook from Amazon.
Also see the companion volume: Applying C
or email your comment to: email@example.com
|Last Updated ( Tuesday, 11 September 2018 )|