Thursday, August 21, 2014

Writing C code on Windows using Geany and GNU

I have to provide a simple instruction to install an IDE "Integrated Development Environment" for  my students to be able to work on the assignments on their computers.
After doing a lot of research I found two options, Monodevelop and Geany. They both work great on Ubuntu Linux and have no issues, but, to use them on Windows I started to deal with the unknown...

Working with Monodevelop: monodevelop
Monodevelop will install fine in windows under different name, the issue is it does not support C programming language. At least out of the box. However, I read some blogs stating that we can somehow get it to compile C...  So, this is not what I am looking for and I can not expect my students to waste their time with these hacks at this time.  NOT AN OPTION.
Note:
it works fine on Ubuntu Linux and Mac, so, you can use it fine if this is what you have for Personal Computer...


Working with Geany:  Geany
Geany is a great simple IDE that works on Ubuntu Linux and Windows, as well as Mac.  but it requires the GCC, GNU C Compiler which will need to be installed on Windows.
I came up with the following instructions to help simplify the process of doing that.

Here is a list of download links that will be needed:

  1. Geany download site  Please select"geany-1.24_setup.exe - Full Installer including GTK 2.16."
  2. MinGW "Minimalist GNU for Windows"  Please select "Looking for the latest version? Download mingw-get-setup.exe (86.5 kB)"
Now that you have all required downloads, run both and install by following the default installations.
You should have the following icons on your desktop now,






Now, we will need to setup and install the gcc compiler to be able to compile your C code programs.





  1. Start MinGW by clicking on MinGW Installer shown on your desktop.
  2. you will get the following screen and notice that your list has no items selected in green boxes like my screen shot
  3. Go a head and select the one I have selected, right click and select "Mark for Installation"


    1. mingw-developer-toolkit
    2. mingw32-base
    3. mingw32-gcc-objc
    4. msys-base
  4. Now go to the menu "Installation" , and click on "Update Catalogue"
  5. after the download of needed files and installing them is done, you now have all you need to work on Geany and write your applications, but we need to add the new MinGW to Windows Path...
  6. You will need to go to Control panel
  7. Select System
  8. On the right list click on Advanced System Settings
  9. Now Click on Environment Variables...
  10. You will get this dialog box
  11. find Path  in the System Variables and double click on it
  12. now click on the Variable Value
  13. make sure you are at the end of the text and add the following text  ";C:\MinGW\bin\"
  14. you will be adding everything inside the double quotes
  15. Now, Click on OK and OK again,
  16. when you start Geany and write your own program at this point everything should be all set to compile your new code.