Dev-C++ Installation and C++ Graphics Library Configuration Guide | A Must-Read for Beginners

Today, I bring you a highly practical tutorial:How to install Dev-C++ and configure the C++ graphics library (EasyX), making it easy for you to get started with C++ graphics programming!

đź”§ Step 1: Install Dev-C++

Dev-C++ is a lightweight C/C++ integrated development environment (IDE) suitable for beginners to quickly get started. Here are the installation steps:

1. Download the installation package

Search for dev c++ 6.3 in your browser or download the Dev-C++ installer from the following URL: https://sourceforge.net/projects/embarcadero-devcpp/files/v6.3/.

Dev-C++ Installation and C++ Graphics Library Configuration Guide | A Must-Read for BeginnersDev-C++ Installation and C++ Graphics Library Configuration Guide | A Must-Read for Beginners

2. Run the installation wizard:

  • · After extracting, double-click the installation package, select the language (e.g., Chinese), and click “OK”.

  • Dev-C++ Installation and C++ Graphics Library Configuration Guide | A Must-Read for Beginners
  • · Read the license agreement and check “I accept”.

  • Dev-C++ Installation and C++ Graphics Library Configuration Guide | A Must-Read for Beginners

    · Select components (default is all selected) and click “Next”.

  • Dev-C++ Installation and C++ Graphics Library Configuration Guide | A Must-Read for Beginners
  • · Choose the installation path and click “Install”.Dev-C++ Installation and C++ Graphics Library Configuration Guide | A Must-Read for Beginners

  • · Wait for the installation to complete, then click “Finish” to start Dev-C++.

  • Dev-C++ Installation and C++ Graphics Library Configuration Guide | A Must-Read for BeginnersDev-C++ Installation and C++ Graphics Library Configuration Guide | A Must-Read for Beginners

🎨 Step 2: Configure the C++ Graphics Library (Using EasyX as an Example)

EasyX is a lightweight C++ graphics library for Windows, suitable for drawing windows, lines, graphics, etc., and is friendly for beginners.

1. Download the EasyX library

Download the corresponding library files for Dev-C++ from the EasyX official website ( https://easyx.cn/ ), such as

the download link for easyx4mingw25.9.10 is https://codebus.cn/bestans/easyx-for-mingw .

Dev-C++ Installation and C++ Graphics Library Configuration Guide | A Must-Read for BeginnersDev-C++ Installation and C++ Graphics Library Configuration Guide | A Must-Read for Beginners

2. Extract and configure the library files

· Extract the library files: Unzip the downloaded ZIP package to any directory

Dev-C++ Installation and C++ Graphics Library Configuration Guide | A Must-Read for Beginners· Configure the files: Locate the Dev installation folderDev-C++ Installation and C++ Graphics Library Configuration Guide | A Must-Read for Beginners· Enter TDM-GCC-64Dev-C++ Installation and C++ Graphics Library Configuration Guide | A Must-Read for Beginners· Find the x86_64-w64-mingw32 folderDev-C++ Installation and C++ Graphics Library Configuration Guide | A Must-Read for Beginners· Copy the extracted EasyX library files into the corresponding dev installation folderDev-C++ Installation and C++ Graphics Library Configuration Guide | A Must-Read for BeginnersStep 3: Test the graphics library1. Open the Dev-C++ software and create a new projectDev-C++ Installation and C++ Graphics Library Configuration Guide | A Must-Read for BeginnersDev-C++ Installation and C++ Graphics Library Configuration Guide | A Must-Read for Beginners2. Test the graphics library: Write a simple test program

#include <graphics.h>  // EasyX core header file#include <conio.h>     // For waiting for a key press
int main() {    // Initialize the graphics window (width 640, height 480)    initgraph(640, 480);  
    // Set background color to black, clear the screen    setbkcolor(BLACK);      cleardevice();  
    // Draw a red rectangle    setlinecolor(RED);      rectangle(100, 100, 300, 300);  
    // Wait for a key press before closing the window    getch();      closegraph();  
    return 0;}

3.Set the link library: Open Project—Project Properties—Parameters, and enter the following in the linker: -static-libgcc -lEasyX -lgdi32 -lole32Dev-C++ Installation and C++ Graphics Library Configuration Guide | A Must-Read for BeginnersDev-C++ Installation and C++ Graphics Library Configuration Guide | A Must-Read for Beginners4. Compile and runDev-C++ Installation and C++ Graphics Library Configuration Guide | A Must-Read for BeginnersIf a window appears with a black background and a red rectangle, it means the configuration was successful!Dev-C++ Installation and C++ Graphics Library Configuration Guide | A Must-Read for Beginners

Leave a Comment