by

Bloodshed Dev C++ Tutorial

What is Dev-C++?
Dev-C++, developed by Bloodshed Software, is a fully featured graphical IDE (Integrated Development Environment), which is able to create Windows or console-based C/C++ programs using the MinGW compiler system. MinGW (Minimalist GNU* for Windows) uses GCC (the GNU g++ compiler collection), which is essentially the same compiler system that is in Cygwin (the unix environment program for Windows) and most versions of Linux. There are, however, differences between Cygwin and MinGW; link to Differences between Cygwin and MinGW for more information.

Click picture to enlarge.

Bloodshed Dev-C is a full-featured Integrated Development Environment (IDE) for the C/C programming language. It uses Mingw port of GCC (GNU Compiler Collection) as it's compiler. Dev-C can also be used in combination with Cygwin or any other GCC based compiler. Sep 18, 2010 C Programming Tutorial - 1 - Installing Dev C thenewboston. Unsubscribe from thenewboston? Cancel Unsubscribe. Subscribe Subscribed Unsubscribe 2.41M. About Dev-C Dev-C is a free integrated development environment (IDE) for programming in C/C. Dev-C is developed by Bloodshed software. It is shipped with the open source MinGW compiler. MinGW uses GCC,the GNU g compiler collection. With Dev-C you can write Windows or console-based C/C programs easily.

Bloodshed!?
I'll be the first to say that the name Bloodshed won't give you warm and fuzzies, but I think it's best if the creator of Bloodshed explains:

First I would like to say that I am not a satanist, that I hate violence/war and that I don't like heavy metal / hard-rock music. I am french, but I do know the meaning of the 'Bloodshed' word, and I use this name because I think it sounds well. If you are offended by the name, I am very sorry but it would be a big mess to change the name now.

There's also a reason why I keep the Bloodshed name. I don't want people to think Bloodshed is a company, because it isn't. I'm just doing this to help people.

Here is a good remark on the Bloodshed name I received from JohnS:
I assumed that this was a reference to the time and effort it requires of you to make these nice software programs, a la 'Blood, Sweat and Tears'.

Peace and freedom,

Colin Laplace

Getting Dev-C++
The author has released Dev-C++ as free software (under GPL) but also offers a CD for purchase which can contain all Bloodshed software (it's customizable), including Dev-C++ with all updates/patches.

Link to Bloodshed Dev-C++ for a list of Dev-C++ download sites.

You should let the installer put Dev-C++ in the default directory of C:Dev-Cpp, as it will make it easier to later install add-ons or upgrades.

Using Dev-C++
This section is probably why you are here.

All programming done for CSCI-2025 will require separate compilation projects (i.e. class header file(s), class implementation file(s) and a main/application/client/driver file). This process is relatively easy as long as you know what Dev-C++ requires to do this. In this page you will be given instructions using the Project menu choice. In another handout you will be given instructions on how to manually compile, link and execute C++ files at the command prompt of a command window. See here.

Step 1: Configure Dev-C++.
We need to modify one of the default settings to allow you to use the debugger with your programs.

  • Go to the 'Tools' menu and select 'Compiler Options'.
  • In the 'Settings' tab, click on 'Linker' in the left panel, and change 'Generate debugging information' to 'Yes':
  • Click 'OK'.

Step 2: Create a new project.
A 'project' can be considered as a container that is used to store all the elements that are required to compile a program.

  • Go to the 'File' menu and select 'New', 'Project..'.
  • Choose 'Empty Project' and make sure 'C++ project' is selected.
    Here you will also give your project a name. You can give your project any valid filename, but keep in mind that the name of your project will also be the name of your final executable.
  • Once you have entered a name for your project, click 'OK'.
  • Dev-C++ will now ask you where to save your project.

Step 3: Create/add source file(s).
You can add empty source files one of two ways:

  • Go to the 'File' menu and select 'New Source File' (or just press CTRL+N) OR
  • Go to the 'Project' menu and select 'New File'.
    Note that Dev-C++ will not ask for a filename for any new source file until you attempt to:
    1. Compile
    2. Save the project
    3. Save the source file
    4. Exit Dev-C++

You can add pre-existing source files one of two ways:
  • Go to the 'Project' menu and select 'Add to Project' OR
  • Right-click on the project name in the left-hand panel and select 'Add to Project'.
EXAMPLE: Multiple source files
In this example, more than 3 files are required to compile the program; The 'driver.cpp' file references 'Deque.h' (which requires 'Deque.cpp') and 'Deque.cpp' references 'Queue.h' (which requires 'Queue.cpp').

Step 4: Compile.
Once you have entered all of your source code, you are ready to compile.

  • Go to the 'Execute' menu and select 'Compile' (or just press CTRL+F9).

    It is likely that you will get some kind of compiler or linker error the first time you attempt to compile a project. Syntax errors will be displayed in the 'Compiler' tab at the bottom of the screen. You can double-click on any error to take you to the place in the source code where it occurred. The 'Linker' tab will flash if there are any linker errors. Linker errors are generally the result of syntax errors not allowing one of the files to compile.

Once your project successfully compiles, the 'Compile Progress' dialog box will have a status of 'Done'. At this point, you may click 'Close'.

Step 5: Execute.
You can now run your program.

  • Go to the 'Execute' menu, choose 'Run'.
Note: to pass command-line parameters to your program, go to the 'Execute' menu, choose 'Parameters' and type in any paramaters you wish to pass.

Disappearing windows
If you execute your program (with or without parameters), you may notice something peculiar; a console window will pop up, flash some text and disappear. The problem is that, if directly executed, console program windows close after the program exits. You can solve this problem one of two ways:

  • Method 1 - Adding one library call:
    On the line before the main's return enter:
    system('Pause');
  • Method 2 - Scaffolding:
    Add the following code before any return statement in main() or any exit() or abort() statement (in any function):
    /* Scaffolding code for testing purposes */
    cin.ignore(256, 'n');
    cout << 'Press ENTER to continue..'<< endl;
    cin.get();
    /* End Scaffolding */
    This will give you a chance to view any output before the program terminates and the window closes.
  • Method 3 - Command-prompt:
    Alternatively, instead of using Dev-C++ to invoke your program, you can just open an MS-DOS Prompt, go to the directory where your program was compiled (i.e. where you saved the project) and enter the program name (along with any parameters). The command-prompt window will not close when the program terminates.

For what it's worth, I use the command-line method.

Step 6: Debug.
When things aren't happening the way you planned, a source-level debugger can be a great tool in determining what really is going on. Dev-C++'s basic debugger functions are controlled via the 'Debug' tab at the bottom of the screen; more advanced functions are available in the 'Debug' menu.

Using the debugger:
The various features of the debugger are pretty obvious. Click the 'Run to cursor' icon to run your program and pause at the current source code cursor location; Click 'Next Step' to step through the code; Click 'Add Watch' to monitor variables.
Setting breakpoints is as easy as clicking in the black space next to the line in the source code.
See the Dev-C++ help topic 'Debugging Your Program' for more information.

Dev-C++ User F.A.Q.

Why do I keep getting errors about 'cout', 'cin', and 'endl' being undeclared?
It has to do with namespaces. You need to add the following line after the includes of your implementation (.cpp) files:

How do I use the C++ string class?
Again, it probably has to do with namespaces. First of all, make sure you '#include <string>' (not string.h). Next, make sure you add 'using namespace std;' after your includes.

Example:

That's it for now.
I am not a Dev-C++ expert by any means (in fact, I do not teach C++ nor use it on a regular basis), but if you have any questions, feel free to email me at jaime@cs.uno.edu

Happy coding!

The Compilersresources page

Here you'll find free compilers including sometimes their sources and articles on writing a compiler.A forum to discuss about compilers and programming is available at http://bloodshed.net/forum. If you want to contact me about this page, senda mail to compilers@bloodshed.net

Last updated: 18/05/2002

If you know of any resources about compilers I could add to thispage, please submitit.

This page is divided into 4 sections (some may be added infuture).

1°)Freecompilers (with source code)

1°)Freecompilers

Here is the free compilerslist. If you want to add a new one to this list, click here.

Turbo Pascal and Turbo C: Borlandhas released for free version 1.0, 3.2 and 5.5 of its famousTurbo Pascal.

Dev-Pascal :FreeIDE and compiler for Pascal (with Free Pascal).

Dev-C++ : Free IDE and compiler for the C and C++ languages.Delphi and C source code available.

SmallC : Small C compiler written by J. E.Hendrix. C source code included.

Bloodshed Dev C++ Tutorial 2016

BCX : Very powerful and easy to usesystem which generates C code capable of compiling underLcc-Win32 and MingW32 (or Dev-C++) without anymodification. It also comes with a resource translatorwhich can read MS resource's code and produce code in C (Win32).

CoPascal : Co-Pascal is an extension ofthe Pascal-S compiler developed by N. Wirth. Pascal source codeincluded.

P32: Pascal compiler. Currently in development but works great.Pascal source included.

PowerPascal : Power Pascal is afully 32-bit, native Pascal compiler for OS/2 2.0 or better.Pascal source included.

Djgpp: THE free compiler for c, c++, forth, pascal and more includingC sources.

TinyPascal: A small implementation of the Pascal language. Full Delphisources included.

FreePascal :32-bit Pascalcompiler for Dos, Linux, OS/2. Pascal source code included. Usedin Dev-Pascal.

ScriptBasic: Free embeddable and extendable scripting basic interpreter withfull C source code. Tested on Windows NT and on Linux.

LCC-Win32: a free compiler system for Windows by Jacob Navia.

lcc : lccis a retargetable compiler for ISO Standard C. It generates codefor the ALPHA, SPARC, MIPS R3000, and Intel x86 and itssuccessors.

Yabasic:Small basic interpreter(with source code for Visual C++ 6) for Windows and Linux

Pacific C for DOS : Freewareversion for MSDOS of a professional C IDE/compiler shareware

Bloodshed Dev C++ Tutorials

TopLogo++ : This is an IDE/compilertool for developers and scientists. The package includes fulldocumentation, Compiler IDE, demos, help etc..

JavaTM 2 SDK : JavaTMSoftware Development Kits and Runtimes

XBasic :interactive program development environment, advanced32-bit/64-bit BASIC, interactive graphical GuiDesigner,multi-platform portable source code, Windows95 - Windows98 -WindowsNT - Linux - UNIX

XSCompiler: This MSDOS compiler generates 32-bit protected mode programs from a language that is C compatible, but includes classes and multiple inheritance. It comes with the standard C library, graphics, sound, multitasking, compression, animation, GIF, PCX, FLI/FLC, and other libraries. The compiler itself is compiled using this language.

GNAT : GNAT is an Ada95compiler with the source code available in Ada95.

Cooking

Rapid-Q : Rapid-Q is a free IDE andBASIC op-code compiler system for Win32, Linux, Unix.. Itis very easy to use and to integrate with many other goodies likemySQL, cgi, DirectX, Direct3D, GTK ..

Mingw: A very good Win32 port of the GNU GCC compiler (used inDev-C++)

Cygwin : Another free and good Win32 port of GCC and GNUUtils

GCC : THEone and only GCC compiler system. Runs on nearly any system.

Phoenix/Envelop : Rapid Development under Basic.

B++ : B++ is a BASIC compiler built on top of C++ - it converts BASIC code to C++, and then calls C++ compiler to produce EXE (or DLL). Source code is in Free Pascal.

GNU Ada : Free ADA compiler.

Dev86 / BCC : x86 C/Assembler development tools (C compiler, assembler, linker). Under the GPL. Linux and DOS binary distributions available.

http://www.digitalmars.com : FREE C/C++ Compiler for DOS, Win & NT by theauthor of Zortech C++.

Virtual Pascal : A tool of choice for 32-bit cross-platform development using the Pascal language. It is compatibile with Borland Pascal and Delphi, including the Run-Time Library (RTL), an optimizing compiler, a powerful integrated debugger, and comprehensive online documentation.

PlugSys Xbase compiler : PlugSys has a free edition and a Professional edition on their web site. It is a character based compiler for the Xbase(dbase, clipper) language. There are both DOSWin95/98/NT and Linux version. Same code compiles on either system. Also has a server page tool (free and pay versions). The documentation that comes with the download is great. Free version only requires registration to download.

Traktor pro 2.11 rar. Mar 12, 2020  Traktor Pro Crack is a DJ program tool kit software. It is introduced by the native instruments. You can also use it as a sub-brand for native tools, linked DJ hardware creations. TRAKTOR can easily operate on Microsoft Windows, Mac OS,. Getting started with TRAKTOR PRO 3 CRAFTED TO PERFORM Almost two decades ago, we created the first DJ software to truly conquer the club. Since then, it’s filled sound systems and dancefloors across the world, as well as house parties, bars, beaches, and everything in between. Now, with TRAKTOR PRO 3, we’ve built on that past to bring you. May 07, 2018  Traktor Pro 2 Crack is a DJ software package that is developed by the Native Instruments. It enables the professional DJs to effortlessly mix synchronically any number of audio tracks and samples to get a new music production. Traktor Pro 2 Crack Mac is the world best professional DJ software which gets you mixing immediately out your box.

Context programming language : Simple programming language and compiler for MS-DOS with sources and sample programs on it's own input language by Andrei V. Khokhlov

Babya : B++ compiler for DOS with setup and Windows 9x support.

OpenWatcom : Open Watcom is a joint effort between SciTech Software, Sybase®, and a select team of developers, which will bring the Sybase Watcom C/C++ and Fortran compiler products to the Open Source community.

Self : A port of a compiler for the Self programming language to Linux. The system was originally developed at Stanford University and Sun, and it forms the technological base of the Java Hotspotcompiler. A nice GUI is included.

SmallEiffel : The GNU compiler for the Eiffel language. Requires an ANSI C compiler. Supports AIX, Amiga, BeOS, BSD, Cygwin, MSDOS, FreeBSD, GNU/Hurd, GNU/Linux, HP-UX, IRIX, MacOS, NetBSD, NeXT, OS/2, OSF1, QNX, SCO, Solaris, OpenVMS, Windows 95/98/NT/2K and XENIX.

Inno Pascal : Inno Pascal is a simple Pascal compiler for Win32. It produces compact, native-code x86 executables without requiring any external assemblers or linkers. It was written entirely from scratch; it is not based on any other existing compilers. Full source code is included under the GPL license.

Harbour Project : Harbour is an Open Source Clipper Compatible Compiler. It includes OO extentions, and lots of useful adds. The Licence is GNU+Harbour Exception, what means that the licence does not infects the programs you produce with the compiler.

2°)Compilersconstruction toolkits

Here is the compilersconstruction toolkit list. If you want to add a new one to thislist, clickhere.

Bison and Flex :Yacc and Lex clones. Creates parsers and scanners for compilers.
TPYacc and TPLex:Port of the Yacc and Lex tools to Turbo Pascal. This toolscreates parsers and lexical scanners for compilers.
Coco/R : Coco/Rcombines the functionality of the well-known UNIX tools lex andyacc, to form an extremely easy to use
compiler generator that generates recursive descent parsers.Available versions ( Oberon, Modula-2, Pascal, Delphi, C andJava) for more info see http://cs.ru.ac.za/homes/cspt/cocor.htm
antlr: another tool for language recognition Tool written in Java forgenerating recognizers in Java or C++. No money requiredfor use, but download requires online registration for authorstracking purposes. Runs with SUN Java SDK.
Delphi Compiler Generator : Runs on Win32 only, written in Delphi, source code included. Free (as in 'free beer', not 'free speech') for non commercial use
GENTLE Compiler Construction System : This compiler construction tool purports to provide a uniform framework for language recognition, definition of abstract syntax trees, construction of tree walkers based on pattern recognition, smart traversal, simple unparsing for source to source translation and optimal code selection for microprocessors. Note however that if you use it to create an application, the licensing terms require that your applications be licensed under the GNU GPL.
Jacc : Jacc is a general-purpose parser generator that given a LALR(1) context-free grammar generates the source(s) of a C++ class that implements a parser for the language defined by the grammar. Jacc has a robust and powerful semantic value type system that allows the user to benefit by the OO language environment. Another innovative feature is its customizable code generating back end - the Jamp macro processor which generates the final sources based on a template file and attributes defined in the jacc grammar file. This way the user has better control to the style and structure of the generated code.

Bloodshed

3°)Tutorialsand articles

Here is the tutorials andarticles about compiler writing. If you want to add a new one tothis list, click here.

Let's build a compiler:A very good tutorial on writing a simple compiler in 16 articles.By Jack W. Crenshaw.
Parsing techniques :Free book to download in postscript orpdf about parsing techniques.

4°)Linksto compilers related sites

Dev C++

Compilers.net :Directory and search machine on compilers andprogramming languages
Free compilers list : Lots of links about compilers andconstruction tools. One of the best !
The comp.compilers archive : Archive of the comp.compilersnewsgroup.
http://www.dunfield.com/downloads.htm : 'C' compiler andrelated files
FreeBASIC translators : Free BASIC Translators Home Page
The Free Country - Developer City: Free programming resources including compilers.
Free developer resources : List offree developer resources like: compilers, setup programs, patchmakers, and more.
DevLibrary: Huge programming web site with hundreds of tutorials and fileson several languages.
http://cspt1.cs.ru.ac.za/compilers/: An introduction in C++ to Compilers and Compiler Generators.
http://www.dreamwater.org/jamesfox/fciwin.html: An index to many free compilers and interpreters for Windows.

http://www.scriptol.org: List of programming languages and resources: free compilers, IDEs, etc..

Submityour resource:

If you want to send a resourceto add to this list, please fill the form below and click onSend.