Bloodshed Dev C++ Tutorial

by

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

Sep 25, 2015 Learn how to program in C with Dev-C IDE. Download here: Dev-C is an full-featured Integrated Development Environment. Dev-C Tutorial This lab activity is to demonstrate the basic steps involved in coding, compiling, executing, and testing a program in the Dev-C Integrated Development.

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).

How to get tracklist from traktor pro 2. 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.

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

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.

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.

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.

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

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.

CONTENTS
Background
Obtaining the Software
Installing the Software
Obtaining GLUT Files
Project Settings For anGLUT OpenGL Project
Compiling and RunningYour Project
Background

Bloodshed Dev C++ Tutorial For Beginners

OpenGL is anopen graphics programming librarydeveloped by Silicon Graphics.Programmers use the applicationprogramming interfaces (APIs) of theselibraries in order to writegraphics programs using a variety of different languages including C++,Java, and Python. The purpose of this documentis to enable you to usean open-source integrated development environment (IDE)for writingOpenGL programs using C++.
Writing a program in any programming language requires a text editor,compiler, and linker in order to generate the executable, or softwareapplication that runs on a particular operating system such as WindowsXP or Mac OS X. Tosimplify the task of writing programs, softwaredevelopers created an IDE that organized all of the tasks of writing aprogram into one application. Popular IDEs include NetBeans (Java),Eclipse (multiple languagebindings), and VisualStudio (allMicrosoft-supported languages). NetBeans and Eclipse are freelyavailable, while Visual Studio is not free. Additionally, many ofthese IDEs have more features than you will probably need to use in anintroductory programming course.
Obtainingthe Software
In order to find the best of both worlds-- a free IDE and a fairlystraightforward IDE for C++, I recommend downloading BloodshedSoftware's Dev-C++for writing OpenGL C++ programs. The link toBloodshed Software is: http://www.bloodshed.net.The link to downloading the most recent version of Dev-C++ can be foundat: http://www.bloodshed.net/dev/devcpp.htmland select the link that says 'Dev-C++ 5.0..with Mingw/GCC'. Please beaware that this software only runs on Windowsoperating systems.

Installingthe Software
To install the software, follow these steps:
  1. From the section labeled 'Dev-C++ 5.0..with Mingw/GCC', selectthe SourceForge link or clickhere.

  2. You will be taken to the SourceForge download server. Here, youcan select the serve from which to download Dev-C++. In most cases, itwill be better to choose a mirror (or download server) somewhere in theUnited States; however, this is not required. In the Download column, click on the linkof the server of your choice.

  3. The page will refresh. If a download window does not appear aftera few seconds, click on the link given near the top of the page. Then,choose a location to save the file. Wait while the file downloads.

  4. Find the location on your computer where you downloaded the fileand double-click on the Dev-C++ installation icon. A dialog box willappear indicating the progress of preparing for the installation.

  5. A dialog box will appear asking what language you want for thisinstallation and then press the Ok button.


  6. Review the license agreement. If you are able to accept the termsof the license agreement, press the IAgree button.


  7. Now it is time to select the type of installation. In order tokeep things simple, choose the option Full for the option of Selectthe Type of Install. Make sure that you have sufficient space toperform the full installation.


  8. Select the location where you want the files installed. Becauseof some difficulties that may occur if you install to a directory namethat contains spaces, choose a directory location or make a newdirectory that does not contain spaces. Although program installationshould typically be in C:ProgramFiles, either make a new directory called C:other-programs or simply acceptthe default location of C:Dev-cpp.


  9. Watch the program install the files.


  10. After the installation program installs all of the necessaryfiles, Dev-C++ should be ready to run. If you want to run Dev-C++ now,make sure to check the item labeled RunDev-C++ 5.. Then, click on the Finish button.


The first time that you run Dev-C++, you will have to complete someadditional configuration steps which are listed below:
  1. Read the notice that appears with the beta software.


  2. Configure the software using the dialog boxes. Speicifically, youwill choose the language that you want to use and decide on the styleof the user interface.


  3. If you would like to have a hierarchy of the classes that you areusing and/or would like to have the ability for code to be completed bythe editor if you type in a series of unique letters, select the Yes.. option; otherwise, select the No.. option.


    • If you selected the Yes..option, you will be presented with the option of using a cache toassist the IDE with code completion. Unless there is a good reason notto do so (such as in the case with the IDE using too much memory andCPU power), create the cache now by selecting the Yes.. option and pressing the Next button.

  4. If everything worked as expected, you should see the followingmessage:


ObtainingGLUT Files

Bloodshed Dev C++ Tutorial Youtube

If you are running a Windows computer, the necessary OpenGL filesshould already be available. When in doubt, check the directory C:WINNTsystem32. In thisdirectory, there should be files like opengl32.dlland glu32.dll. If you aremissing any of these files, things will not work correctly when you tryto write OpenGL. Traditionally, the windows that are used for OpenGLprograms were dependent upon the underlying operating system windowmanagement system. This did not allow OpenGL programs to be as portableacross platforms as they should be. To solve this problem, the OpenGLUtility Toolkit, or GLUT, was created. If you have never writtenanyOpenGL programs using GLUT before, the necessary files for running GLUTwill not be avaiable. For this reason, you need to download them. Awebsite which explains how to use Dev-C++ to writeOpenGL GLUT programsalso provides information on where to download the appropriate GLUTfiles in addition to where to put them. The information about how to dothese tasks was taken from: http://www.cs.uofs.edu/~mpc3/cmps370/glutsetup.html.Download the following files from these locations:
  • glut.h fromhttp://www.cs.uofs.edu/~mpc3/cmps370/glut.hand save the file to C:Dev-C++includeGL.
  • glut32.def from http://www.cs.uofs.edu/~mpc3/cmps370/glut32.defand save the file to C:Dev-C++lib.
  • glut32.dll from http://www.cs.uofs.edu/~mpc3/cmps370/glut32.dlland save the file to C:WINNTsystem32.
As stated on the website where thesefiles can be downloaded, make sure to include glut32.dll with anyOpenGL GLUT programs that you distribute since your end-users may nothave this file available for running OpenGL GLUT programs.
ProjectSettings For an GLUT OpenGL Project
In Dev-C++,the IDEorganizes your code files into projects. Forthis reason, you need to specify the project type whenever you beginstart writing a new application. Follow the steps below to setup anOpenGLGLUT project:
  1. From the Dev-C++ menu, select File-> New -> Project. A new dialog box will appear.

  2. Press the Basic tab andselect Console Application fromthe types of projects.

  3. Type the name of the project in the field named Name.

  4. Select the C++ Project optionfrom the box with options.

  5. Press the Ok button.

  6. It would be advisable to keep your projects organized in somehierarchy. It may be suitable to make a new directory that contains allof your Dev-C++ projects or place these Dev-C++ projects in some otherappropriate directory. In any case, choose a location and make surethat the project name is indeed what you want the project to be named.The settings for the project will be stored in a file called project-name.dev where project-name is the name you wantedto name the project.

Below is a picture that shows how things should look when you arefinished filling out the information in the dialog box:
You want to choose a console application because the program that youwrite should not contain any Win32 API code (this is code written thataccesses programming libraries specific to the Windows operatingsystem). The console application will enable you to have code that canbe run on an operating system that does not have Windows.
The next series of steps involves configuring the project options sothat files needed to make an OpenGL GLUT program can be easily found bythe Dev-C++ IDE. Instructions similar to the steps listed below appearon the website whose address is: http://www.cs.uofs.edu/~mpc3/cmps370/glutsetup.html.

Bloodshed Dev C++ Tutorial 2017

  1. From the Dev-C++ menu, select Project-> Project Options. A new dialog box will appear

  2. Press the Parameters tabwhich should make the dialog box appear as seen below:


  3. It is necessary to add libraries that will support the operationof OpenGL and GLUT. Repeat the following steps-- press the Add Library or Object button andthen select the appropriate library file. These files begin with theletters 'lib' and ends in '.a'. It will be necessary to add thefollowing files: libglut32.a, libglu32.a, and libopengl32.a. These files will belocated in the libGL directory of your Dev-C++ installation directory.For instance, one path possibility could be: C:Dev-C++lib. When you arefinished, the dialog should look like this:


  4. Then press the Ok button.

Now, it is necessary to find a sample program. Andrew Johnson of theElectronic Visualization Laboratoryat UIC has a simple C program thatmeets this requirement. You can download it from: http://www.evl.uic.edu/aej/488/code/shell1.c.Either copy and paste the code from the website into the Dev-C++ editoror save the file and load the shell.c file into the current project. Achange that you will likely have to make is to change a line with #include<glut.h> to #include<GL/glut.h>. One thing to note, if you are new toprogramming, C++ is an 'improved' version of C that supports datastructures named objects. This loosely means that C program code can becompiled by a C++ compiler.

Bloodshed Dev C++ Download

Compilingand Running Your Project
Compiling and running the code in your project is veryeasy..but..figuring out why your specific program does not compile orrun can become very difficult. This is true of anyone-- those who havespent a lot of time programming and those people who are learning howto program. Since errors are typically unique to each situation forcompiling or debugging, it is up to you to learn how to do this.Assuming that everything written correctly and the project isconfigured to use the proper libraries, do the following:
  • To compile a file, make sure that this file is visible in theeditor by selecting it from the list of files in the project browserand select Execute -> Compile fromthe menu. If you have multiple files in a project, complete this taskfor each file.

  • To run a file, select from the menu Execute -> Run. If your programneeds parameters in order to run properly, first select Execute -> Parameters and fillin the appropriate values in the dialog box. Then, choose this menuoption Execute -> Run.

There are also buttons that can be pressed to compile and run withouthaving to go to the menu each time you want to compile or run a program.

Dev C++ Codes