Suite101

Get Started with Bloodshed Dev C++

A quick start guide to getting, installing and using Bloodshed Dev C++

© Guy Lecky-Thompson

Sep 1, 2006
DevC++ Screenshot, The Author
Bloodshed Dev C++ is an easy to use IDE, with some great features, but getting started with any new software is always a challenge. This Dev C++ article should help.

About Bloodshed Dev-C++

The Bloodshed Dev-C++ package is a complete compiler, IDE and supporting tools for software creation under the Windows (Win32) operating system. It uses a popular compiler, known as MinGW (Minimal GW), supports both C and C++ and has some useful automation features for Windows software creation. Development for the command line interface is also supported.

The download is very small (about 10 MB), including the editing environment. It runs on any Win32 system - so is great for those trying to rejuvenate old machines as development environments for learning how to program. The software is free - Open Source - and can be downloaded from Source Forge, or the Bloodshed.net main site.

Downloading and Installing Bloodshed Dev-C++

The releases from the main Bloodshed.net site come as ZIP archives containing a standard setup system. The setup creation software can also be downloaded from the Bloodshed site, and used in conjunction with the Bloodshed Dev-C++ environment. This ZIP archive can then be unpacked into a temporary folder.

To install, simply double-click the Setup.exe file, and the process will begin. If you want a clean installation, it is preferable to have Administrative rights, otherwise the setup program might have trouble installing the various shortcuts to the tools that you will be using to create software.

My advice is to accept the installation into the root of the main hard drive, unless you do not have root access to the machine, in which case feel free to put it somewhere else.

Executing the IDE for the first time

For those with a Start bar, selecting Start-Programs-Dev-C++-Dev-C++ will start up the IDE. The first time that this happens, the system will invite you to choose it as the default for several file types. This will only have an effect if you have administrative privileges on the target machine.

The file types that you are offered are:

  • .dev (project)
  • .c, .cpp, .h, .hpp (standard source)

Now, the only reason not to allow this is if there is another compiler system installed on the target platform. If there is, and the IDE has also been configured to pick up these file types, then it is wise not to allow the associations to be modified by Bloodshed Dev-C++. This is particularly important if you are installing to a shared machine.

There is not much chance of the .dev file type conflicting with other packages, unless one of the following is also installed on the system:

  • LaTeX
  • Soundweb London
  • e-Sword (Bible study)

Allowing Bloodshed Dev-C++ to assign these file types will automatically start the IDE when you open a file of that type. This is probably most useful for the .dev file extension, and less appropriate for the others.

The Bloodshed Dev-C++ IDE Layout

From top to bottom, the IDE opens with:

  • The menu and tool bars
  • The Project/File editing area
  • The Compile/Tool status area

Along the menu/tool bars there are the usual options for opening, closing, and editing files, along with some specific ones for compiling and executing programs built with the Bloodshed Dev-C++ IDE. Each button has a tool tip associated with it which are entirely self explanatory.

The center part of the application interface is split into the Project Tree on the left hand side (empty right now) and the editing window. The editing window has a multiple document interface, and will be where the programmer will spend most of their time. It is a full featured editor, with syntax highlighting and coloring?

The bottom pane contains the status of the compiler and linker, along with the output of the resource compiler (fof Win32 development), and a compile log. As an aside - line numbers are useful, but even more so is the ability to click an error and have the editor find it in the relevant file immediately.

Dev-C++ Project Types

One of the first things that a user will do is start a new project. We shall assume that we want to start a typical Hello World project, and we shall call the variants HelloWorld and HelloWindows. There are two options, because there are two types of program that can be built with the Bloodshed Dev-C++ package. One is for the command line, and the other is for Win32.

To start a new project, the user selects File-New Project from the main menu. This closes any previously open projects, and displays the New Project dialog box. There are four types of automated projects:

  • Project - regular projects
  • GUI Toolkits - currently only GTK+ is supported
  • Additional - simple templates
  • Graphics - currently only an OpenGL template

The most useful of these for general programming are on the initial Project tab:

  • Windows Application - a skeleton Win32 application
  • Console Application - just a main function and useful includes
  • DLL - for creating dynamic link libraries

To start a HelloWorld project, the user might select the Console Application project. Each time a project is started, the user is invited to select a project name, and a .dev file will be created. It is useful to put each project, in its' entirety, into a folder with an appropriate name, to keep it separate from other source code collections and projects.

The system will then create a project tree, and a simple text file containing the main function, and some useful #includes for the basic libraries. The first useful action to perform is to save the file by selecting File-Save Unit from the main menu. This project can be built as-is, but will not do anything. This is achieved by clicking the button with a green tick symbol, or selecting Execute-Compile from the main menu, or even pressing the F9 key whilst holding down the control key.

To run, press the F9 key. If a console application is being built, then a Command Line (DOS) box will appear, if not, then the main application window should appear. If the DOS box appears, and then disappears, it might be useful to put some form of pause command as the last statement in the source code ('Press any Key...' for example). This is left as a last exercise for the reader! Have fun!


The copyright of the article Get Started with Bloodshed Dev C++ in Computer Programming is owned by Guy Lecky-Thompson. Permission to republish Get Started with Bloodshed Dev C++ in print or online must be granted by the author in writing.




Post this Article to facebook Add this Article to del.icio.us! Digg this Article furl this Article Add this Article to Reddit Add this Article to Technorati Add this Article to Newsvine Add this Article to Windows Live Add this Article to Yahoo Add this Article to StumbleUpon Add this Article to BlinkLists Add this Article to Spurl Add this Article to Google Add this Article to Ask Add this Article to Squidoo