Return to site

How To Use Dev C++

broken image


Jul 07, 2017 dev c debug, dev c debug not working, dev c debug watch variable, dev c debugger, dev c debugger not working. May 21, 2016  this program dont work on dev c, how can i use delay function on dev? #include #include #include using namespace std. Installation and Use Even though DEV-C is filled with advanced compiler, debugger and a wide array of dev tools, it's installation package is quite small (only around 50 MB) and therefore can be easily installed on any modern Windows PC or laptop. Just follow the onscreen instructions, and in mere seconds DEV C plus plus will be ready for.

How to Install Dev-C++ and the GLUT Libraries
for Compiling OpenGL Programs with ANSI C

(version of July 16, 2009)

These notes explain how to compile programs written in ANSI C with OpenGL and GLUT using the Dev-C++ compiler.

Bloodshed Dev-C++ is a free C++ compiler and development environment for Windows operating systems. Like most C++ compilers, it also can be used to compile ANSI C. By installing the GLUT header and library files, it can be used to write programs that use OpenGL. This is needed to run programs for Edward Angel's textbook, Interactive Computer Graphics 5th edition and possibly other computer graphics texts.

These notes do not explain how to compile OpenGL with C++ . The 6th edition of Angel's book uses C++ which will not work with these notes.

These instructions have been tested on a small variety of Windows 2000 and Windows XP systems. These systems come with the files needed for OpenGL, but not the files needed for GLUT.

Dev-C++ does not work well with Microsoft's Vista. The problem, and a possible fix, is discussed here: http://aresio.blogspot.com/2007/06/vista-and-dev-cpp.html but I have not tested this information.

I. Download Dev-C++ from http://www.bloodshed.net/dev/devcpp.html and install it.

Details:

Get Dev-C++ 5.0 beta 9.2 (4.9.9.2) (9.0 MB) with Mingw/GCC 3.4.2 Although this is a 'beta' version, it works perfectly fine. Click on SourceForge to go to a list of download sites and pick one. The file will be something like devcpp4.9.9.2_setup.exe. Save this file in a place like C:Temp.

When the download is complete, click on the 'open' button to start the installation process. (Or go to C:Temp andDouble click on devcpp4.9.9.2_setup.exe). You will see a few screens that ask you to pick a language (English) and to agree to the license terms. Choose a 'typical' installation.

Accept the suggested destination for the installation:

Many subdirectories and files are extracted to the destintion:

Answer 'yes' when it asks if you wish to install Dev-cpp for all users. Note: if the installation fails, re-install and try 'no' for this.

A screen says the installation is complete:

Keep the check mark in the box. Click on 'Finish'. A first-time configuration screen appears:

Pick 'English' and 'New Look'. In the next several screens, hit 'Yes' for its suggestions.

Eventually you are done. Click 'OK'.

II. DEV-C++ starts up. Try out the installation with a simple C program.

Details:

The program starts up automatically.

Click File/New/Project. Pick a name for the project (such as 'myProject'). Click 'C Project'. Click on 'Empty Project'. Click 'OK'.

In 'Create New Project', click 'save' (later on you will probably want to create separate subdirectories for your various projects.).

Click 'File/New/Source File' and in 'Add source file to current project' click 'Yes'. You now get a screen where you can edit the source file.

Type in a simple C program, as below. Now click 'File/Save As' and save the file as 'hello.c' (or other name.) Important: be sure that the file extension is .c. With any other extension (such as the suggested .cpp) you will have problems compiling.

Now click 'Execute/Compile and Run'

The program will (hopefully) compile, run, and write its output to a DOS window. If you have the system('pause') statement in your program, the output will stay in the window until you hit a key. Another way to run the program (after it has been compiled) is to start a DOS window outside of the Dev-Cpp system, then navigate to the subdirectory that holds your project, and type hello.exe.

At this point, the compiler and development environment has been installed. You should find Dev-C++ listed under 'Programs' on the 'Start' menu and will now be able to write, compile, and run C (and C++) programs. You will have include files, libraries, and dll's for OpenGL (and all other standard packages) but not GLUT. GLUT manages the windows and other user interface components needed for OpenGL programming, and needs to be separately installed.

If you do not need GLUT , you can quit now.

III. Download and install GLUT

To run OpenGL with GLUT (which is what the programs in Angel's book use), you need to get three files and place each file in its proper directory. All the files you need (and more) are contained in one zip file.

Details:

Download GLUT files from http://chortle.ccsu.edu/Bloodshed/glutming.zip Download the file glutming.zip Save the zip file in some convenient location (perhaps C:temp).

Double click on glutming.zip (or otherwise unzip it). You will see the files that are in the zip archive. (Your un-zipping program will probably be diferent than the one shown here, but should work about the same.)

Click on 'Extract' to extract all the subdirectories and files. Pick some convenient directory to extract them to (perhaps C:tempglutming). You only need three files, but extract all of them anyway.

Only three of the files in the various subdirectories are needed. Each of the three files should be put in a subdirectory with other files of its type. Use Explorer to move the files to where they are needed.

Note: If you only see some of these files listed in Explorer, click on 'View/Options/View' and then select the radio button 'Show all Files'.

glut.h -- copy this file to C:Dev-CppincludeGL

Copy from your 'unzipped' subdirectories (wherever they are):

To here:

libglut32.a -- copy this file from your unzipped directories to C:Dev-Cpplib

There may be a newer version of this file there, already. Replace that version with the one you unzipped (if you keep the newer version your programs will not link correctly.)

Copy from your 'unzipped' subdirectories:

To here:

glut32.dll -- move this file to C:WINNTSystem32, or similar location.

The location for this file depends on your operating system. The directory where it goes is the directory that holds the dynamic load libraries (*.dll). An easy way to find where it should go is to look for glu32.dll (use 'Search' from the start menu).

The directory to use should also have the files glu32.dll and opengl32.dll. These should have come with your operating system.

IV. Test Dev-cpp with GLUT

The essential step in compiling and running a C program that contains OpenGL and GLUT functions is to tell the linker where the libraries are. This is done by clicking Project/Project Options/Parameters/Add Library or Options and then navigating to the libraries you need to include: libopengl32.a, libglu32.a, and libglut32.a. The libraries should be added in that order.

Details:

a. Create a subdirectory for a project. Do this first, before you start Dev-Cpp. Create a new subdirectory with 'Explorer' by clicking 'File/New/Folder'.

For example, create a folder C:GLproject.

b. Start Dev-cpp:

c. Start a new project by clicking File/New/Project. In the panel that pops up, name the project something like 'rectangle', click on 'empty project' and 'C': Click OK.

Note: For compiling with OpenGL you must create a project. You need to have a project (not just a single C file) in order to link in the OpenGL libraries.

d. In the next panel, navigate to your folder C:GLproject, and click 'Save'.

e. In Dev-C++, click 'File/New/Source File' and then in the next panel 'Add to Project' click 'yes'. Click 'File/Save As' and then give the file a name. Navigate to your project subdirectory to save the file in it. Name the file something like 'rectangle.c'

Be sure that the file names ends with '.c' anything else will cause big problems.

f. Click and drag your mouse over the following program so that it is highlighted, then click 'Edit/Copy' from the browser's menu bar.

g. Now click in the editing window of Dev-cpp and then click 'Edit/Paste' in its menu bar. The program will appear in the editing window.

h. Click 'File/Save'. The file in your project directory should now contain an OpenGL program.

i. Tell Dev-cpp what libraries need to be linked. Click 'Project/Project Options'.

j. Now click 'Parameters'. Click the 'Add Library or Object' button and navigate to the libraries that should be added, found under C:Dev-cpplib

  • ../lib/libopengl32.a
  • ../lib/libglu32.a
  • ../lib/libglut32.a

Add them in that order (only). Notice that the slashes will appear in Unix style '/' rather than DOS-style '.

When you are done adding the three libaries, you should see:

The exact pattern of '../../..' you see depends on how deep in the directory structure your source file lies.

Click 'OK'.

k. Click 'Execute/Compile and Run'. The program should compile, link, and run:

If things don't work (very common) click on the 'Compile Log' tab for some confusing error messages. If you see something like the following, it means that you made a mistake in adding the libraries to the project:

Try to fix the list of libraries, or perhaps start over from scratch.

You now are finished, or have given up.

-->

If you haven't downloaded and installed Visual Studio and the Visual C++ tools yet, here's how to get started.

How To Use Dev C ++

Visual Studio 2019 Installation

Welcome to Visual Studio 2019! In this version, it's easy to choose and install just the features you need. And because of its reduced minimum footprint, it installs quickly and with less system impact.

Note

This topic applies to installation of Visual Studio on Windows. Visual Studio Code is a lightweight, cross-platform development environment that runs on Windows, Mac, and Linux systems. The Microsoft C/C++ for Visual Studio Code extension supports IntelliSense, debugging, code formatting, auto-completion. Visual Studio for Mac doesn't support Microsoft C++, but does support .NET languages and cross-platform development. For installation instructions, see Install Visual Studio for Mac.

Want to know more about what else is new in this version? See the Visual Studio release notes.

Ready to install? We'll walk you through it, step-by-step.

Step 1 - Make sure your computer is ready for Visual Studio

Before you begin installing Visual Studio:

  1. Check the system requirements. These requirements help you know whether your computer supports Visual Studio 2019.

  2. Apply the latest Windows updates. These updates ensure that your computer has both the latest security updates and the required system components for Visual Studio.

  3. Reboot. The reboot ensures that any pending installs or updates don't hinder the Visual Studio install.

  4. Free up space. Remove unneeded files and applications from your %SystemDrive% by, for example, running the Disk Cleanup app.

For questions about running previous versions of Visual Studio side by side with Visual Studio 2019, see the Visual Studio 2019 Platform Targeting and Compatibility page.

Step 2 - Download Visual Studio

Next, download the Visual Studio bootstrapper file. To do so, choose the following button, choose the edition of Visual Studio that you want, choose Save, and then choose Open folder.

Step 3 - Install the Visual Studio installer

Run the bootstrapper file to install the Visual Studio Installer. This new lightweight installer includes everything you need to both install and customize Visual Studio.

  1. From your Downloads folder, double-click the bootstrapper that matches or is similar to one of the following files:

    • vs_community.exe for Visual Studio Community
    • vs_professional.exe for Visual Studio Professional
    • vs_enterprise.exe for Visual Studio Enterprise

    If you receive a User Account Control notice, choose Yes.

  2. We'll ask you to acknowledge the Microsoft License Terms and the Microsoft Privacy Statement. Choose Continue.

Step 4 - Choose workloads

After the installer is installed, you can use it to customize your installation by selecting the workloads, or feature sets, that you want. Here's how.

  1. Find the workload you want in the Installing Visual Studio screen.

    For core C++ support, choose the 'Desktop development with C++' workload. It comes with the default core editor, which includes basic code editing support for over 20 languages, the ability to open and edit code from any folder without requiring a project, and integrated source code control.

    Additional workloads support other kinds of C++ development. For example, choose the 'Universal Windows Platform development' workload to create apps that use the Windows Runtime for the Microsoft Store. Choose 'Game development with C++' to create games that use DirectX, Unreal, and Cocos2d. Choose 'Linux development with C++' to target Linux platforms, including IoT development.

    The Installation details pane lists the included and optional components installed by each workload. You can select or deselect optional components in this list. For example, to support development by using the Visual Studio 2017 or 2015 compiler toolsets, choose the MSVC v141 or MSVC v140 optional components. You can add support for MFC, the experimental Modules language extension, IncrediBuild, and more.

  2. After you choose the workload(s) and optional components you want, choose Install.

    Next, status screens appear that show the progress of your Visual Studio installation.

Tip

At any time after installation, you can install workloads or components that you didn't install initially. If you have Visual Studio open, go to Tools > Get Tools and Features... which opens the Visual Studio Installer. Or, open Visual Studio Installer from the Start menu. From there, you can choose the workloads or components that you wish to install. Then, choose Modify.

Step 5 - Choose individual components (Optional)

If you don't want to use the Workloads feature to customize your Visual Studio installation, or you want to add more components than a workload installs, you can do so by installing or adding individual components from the Individual components tab. Choose what you want, and then follow the prompts.

Devc++ windows 10

Step 6 - Install language packs (Optional)

By default, the installer program tries to match the language of the operating system when it runs for the first time. To install Visual Studio in a language of your choosing, choose the Language packs tab from the Visual Studio Installer, and then follow the prompts.

Change the installer language from the command line

Another way that you can change the default language is by running the installer from the command line. For example, you can force the installer to run in English by using the following command: vs_installer.exe --locale en-US. The installer will remember this setting when it's run the next time. The installer supports the following language tokens: zh-cn, zh-tw, cs-cz, en-us, es-es, fr-fr, de-de, it-it, ja-jp, ko-kr, pl-pl, pt-br, ru-ru, and tr-tr.

Step 7 - Change the installation location (Optional)

You can reduce the installation footprint of Visual Studio on your system drive. You can choose to move the download cache, shared components, SDKs, and tools to different drives, and keep Visual Studio on the drive that runs it the fastest.

How To Use Dev C++

Step 6 - Install language packs (Optional)

By default, the installer program tries to match the language of the operating system when it runs for the first time. To install Visual Studio in a language of your choosing, choose the Language packs tab from the Visual Studio Installer, and then follow the prompts.

Change the installer language from the command line

Another way that you can change the default language is by running the installer from the command line. For example, you can force the installer to run in English by using the following command: vs_installer.exe --locale en-US. The installer will remember this setting when it's run the next time. The installer supports the following language tokens: zh-cn, zh-tw, cs-cz, en-us, es-es, fr-fr, de-de, it-it, ja-jp, ko-kr, pl-pl, pt-br, ru-ru, and tr-tr.

Step 7 - Change the installation location (Optional)

You can reduce the installation footprint of Visual Studio on your system drive. You can choose to move the download cache, shared components, SDKs, and tools to different drives, and keep Visual Studio on the drive that runs it the fastest.

How To Use Dev C++ In Windows 10

Important

You can select a different drive only when you first install Visual Studio. If you've already installed it and want to change drives, you must uninstall Visual Studio and then reinstall it.

Step 8 - Start developing

  1. After Visual Studio installation is complete, choose the Launch button to get started developing with Visual Studio.

  2. On the start window, choose Create a new project.

  3. In the search box, enter the type of app you want to create to see a list of available templates. The list of templates depends on the workload(s) that you chose during installation. To see different templates, choose different workloads.

    You can also filter your search for a specific programming language by using the Language drop-down list. You can filter by using the Platform list and the Project type list, too.

  4. Visual Studio opens your new project, and you're ready to code!

Visual Studio 2017 Installation

In Visual Studio 2017, it's easy to choose and install just the features you need. And because of its reduced minimum footprint, it installs quickly and with less system impact.

Prerequisites

  • A broadband internet connection. The Visual Studio installer can download several gigabytes of data.

  • A computer that runs Microsoft Windows 7 or later versions. We recommend Windows 10 for the best development experience. Make sure that the latest updates are applied to your system before you install Visual Studio.

  • Enough free disk space. Visual Studio requires at least 7 GB of disk space, and can take 50 GB or more if many common options are installed. We recommend you install it on your C: drive.

For details on the disk space and operating system requirements, see Visual Studio Product Family System Requirements. The installer reports how much disk space is required for the options you select.

Download and install

  1. Download the latest Visual Studio 2017 installer for Windows.

    Tip

    The Community edition is for individual developers, classroom learning, academic research, and open source development. For other uses, install Visual Studio 2017 Professional or Visual Studio 2017 Enterprise.

  2. Find the installer file you downloaded and run it. It may be displayed in your browser, or you may find it in your Downloads folder. The installer needs Administrator privileges to run. You may see a User Account Control dialog asking you to give permission to let the installer make changes to your system; choose Yes. If you're having trouble, find the downloaded file in File Explorer, right-click on the installer icon, and choose Run as Administrator from the context menu.

  3. The installer presents you with a list of workloads, which are groups of related options for specific development areas. Support for C++ is now part of optional workloads that aren't installed by default.

    For C++, select the Desktop development with C++ workload and then choose Install.

  4. When the installation completes, choose the Launch button to start Visual Studio.

    The first time you run Visual Studio, you're asked to sign in with a Microsoft Account. If you don't have one, you can create one for free. You must also choose a theme. Don't worry, you can change it later if you want to.

    It may take Visual Studio several minutes to get ready for use the first time you run it. Here's what it looks like in a quick time-lapse:

    Visual Studio starts much faster when you run it again.

  5. When Visual Studio opens, check to see if the flag icon in the title bar is highlighted:

    If it's highlighted, select it to open the Notifications window. If there are any updates available for Visual Studio, we recommend you install them now. Once the installation is complete, restart Visual Studio.

Visual Studio 2015 Installation

To install Visual Studio 2015, go to Download older versions of Visual Studio. Run the setup program and choose Custom installation and then choose the C++ component. To add C++ support to an existing Visual Studio 2015 installation, click on the Windows Start button and type Add Remove Programs. Open the program from the results list and then find your Visual Studio 2015 installation in the list of installed programs. Double-click it, then choose Modify and select the Visual C++ components to install.

In general, we highly recommend that you use Visual Studio 2017 even if you need to compile your code using the Visual Studio 2015 compiler. For more information, see Use native multi-targeting in Visual Studio to build old projects.

How To Use Dev C++ Pdf

When Visual Studio is running, you're ready to continue to the next step.

How To Use Dev C++ Debugger

Next Steps





broken image