Programming Taskbook


E-mail:

Password:

User registration   Restore password

Russian

SFedU SMBU

1100 training tasks on programming

©  M. E. Abramyan (Southern Federal University, Shenzhen MSU-BIT University), 1998–2024

 

Examples | C and C++ | Configuring IDE

PrevNext


Configuring IDEs for C and C++ languages

This page briefly describes how to config the Visual Studio, Code::Blocks, Dev-C++, and VS Code IDEs for C and C++.

Visual Studio 2017, 2019, 2022 (C++ language)

1. Download and install Visual Studio IDE of the requires version from the Microsoft website https://visualstudio.microsoft.com/ru/downloads/. To work properly with C++ programs, you must install extension "C++ Classical Application Development" using the Visual Studio Installer.

2. Run the PT4Setup program (Start | All programs | Programming Taskbook 4 | PT4 Setup) and make sure that the taskbook has detected the installed Microsoft Visual C++ IDE (version 2017, 2019, or 2022). If the path to the executable file devenv.exe is not found by the taskbook, then specify it by clicking the Browse button. By default, the file devenv.exe is located in C:\Program Files\Microsoft Visual Studio\XXXX\Community\Common7\IDE or C:\Program Files (x86)\Microsoft Visual Studio\20XX\Community\Common7\IDE, where the 20XX subdirectory corresponds the version number (2017, 2019, or 2022). Close the PT4Setup program.

As a result of the steps described above, the taskbook will be set up to be used with the Visual Studio IDE for the C++ language.

Dev-C++ (C and C++ languages)

1. Download and install the Dev-C++ environment. Version 5.11 can be downloaded from the website https://sourceforge.net/projects/orwelldevcpp/ (you can also use this link). Version 6.30 can be downloaded from the website https://www.embarcadero.com/ru/free-tools/dev-cpp (although it is more convenient to use this link). Version 6.30 includes a newer version of the MinGW compiler; in addition, its built-in editor supports UTF-8 encoding.

2. Run the PT4Setup program (Start | All programs | Programming Taskbook 4 | PT4 Setup) and make sure that the taskbook has detected the installed Dev-C++ (C) and Dev-C++ (C++) IDEs (a variant of the Dev-C++ environment for the C language was added in the taskbook version 4.23). If the path to the executable file devcpp.exe is not found by the taskbook, then specify it by clicking the Browse button. By default, the file devcpp.exe is located in C:\Program Files (x86)\Dev-Cpp. Close the PT4Setup program.

As a result of the steps described above, the taskbook will be set up to be used with the Dev-C++ IDE for the C and C++ languages.

Code::Blocks (C and C++ languages)

1. Download and install Code::Blocks IDE from, for example, https://www.fosshub.com/Code-Blocks.php. The Code Blocks Windows 32 bit (including 32 bit compiler) version must be selected. If this version is not available, it can be downloaded at this link.

2. Run the PT4Setup program (Start | All programs | Programming Taskbook 4 | PT4 Setup) and make sure that the taskbook has detected the installed Code::Blocks (C) and Code::Blocks (C++) IDEs (a variant of the Code::Blocks environment for the C language was added in the taskbook version 4.23). If the path to the executable file codeblocks.exe is not found by the taskbook, then specify it by clicking the Browse button. By default, the file codeblocks.exe is located in C:\Program Files (x86)\CodeBlocks. Close the PT4Setup program.

3. Run the PT4Load program, call its context menu (by right-clicking) and select the Code::Blocks (C) or Code::Blocks (C++) command In the Task field, enter the name of a task (for example, Begin1) and press [Enter] of click the Load button. The created template project will be loaded into the Code::Blocks IDE. In the Code::Blocks menu, execute the command Settings | Compiler..., select the Toolchain executables tab in the dialog box which arrears and check that the Compiler installation directory textbox contains the path to the MinGW subdirectory of the Code::Blocks system directory (for example, C:\Program Files (x86)\CodeBlocks\MinGW). If this textbox contains a different path, replace it with the one shown above. Close the dialog box by clicking the OK button. Run the created project by pressing [F9]. If the Code::Blocks environment is set up properly, the taskbook window with the selected task should appear on screen.

As a result of the steps described above, the taskbook will be set up to be used with the Code::Blocks IDE for the C and C++ languages.

VS Code (C and C++ languages)

1. Install the Dev-C++ or Code::Blocks IDE by following the steps described in the corresponding subsections.

2. Install VS Code https://code.visualstudio.com/download#, (Windows, 64 bit, User Installer or System Installer). If you select System Installer, the environment will be installed in the directory C:\Program Files, if you select User Installer, then the environment will be installed in the subdirectory of the current user directory, for example, C:\Users\<UserName>\AppData\Local\Programs\Microsoft VS Code.

3. Run the PT4Setup program (Start | All programs | Programming Taskbook 4 | PT4 Setup) and make sure that the taskbook has detected the Visual Studio Code (C) and Visual Studio Code (C++) IDEs (a variant of the VS Code environment for the C language was added in the taskbook version 4.23). If the path to the executable file Code.exe is not found by the taskbook, then specify it by clicking the Browse button.

4. In the same section of PT4Setup, select the Visual Studio Code (C++) item, click the Additional settings (F9) button and check that the g++.exe file from the MinGW distribution kit included in the Dev-C++ or Code::Blocks IDEs is set up as the C++ compiler for the Visual Studio Code IDE. If the taskbook could not automatically detect the path to the g++ compiler, you can specify it by clicking the Browse button in the Additional settings window. By default, the g++.exe file is located in the MinGW64\bin subdirectory of the Dev-C++ 5.11 IDE system directory, in the TDM-GCC-64\bin subdirectory of the Dev-C++ 6.30 IDE system directory, and in the MinGW\bin subdirectory of the Code::Blocks 20.03 IDE system directory.

Follow the same steps for the Visual Studio Code (C) item. In this case, the Additional settings window should specify the path to the gcc compiler from the MinGW distribution kit. The gcc.exe file is located in the same directories as the g++.exe file (used when configuring the Visual Studio Code (C++) item).

Close the PT4Setup program.

5. Run the PT4Load program, call its context menu (by right-clicking) and select the Visual Studio Code (C) or Visual Studio Code (C++) command. In the Task field, enter the name of a task (for example, Begin1) and press [Enter] of click the Load button. The created template file (with the .c or .cpp extension) will be loaded into the VS Code editor. The first time you load a file with the .c or .cpp extension, the VS Code editor will prompt you to install the C++ language extension pack. When this extension pack is installed, you will be able to start C and C++ programs from VS Code by pressing [F5].

As a result of the steps described above, the taskbook will be set up to be used with the VS Code environment for the C and C++ languages.


PrevNext

 

  Рейтинг@Mail.ru

Designed by
M. E. Abramyan and V. N. Braguilevsky

Last revised:
01.01.2024