Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
28 views13 pages

Objective: Theory: The Integrated Development Environment (IDE)

The document introduces the DEV C++ IDE, detailing its installation and configuration for creating C/C++ programs. It outlines the steps necessary to produce an executable file, including writing source code, compilation, linking, and testing. Additionally, it explains the roles of compilers and linkers, along with the files they require for operation.

Uploaded by

qw7dbcvd7x
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views13 pages

Objective: Theory: The Integrated Development Environment (IDE)

The document introduces the DEV C++ IDE, detailing its installation and configuration for creating C/C++ programs. It outlines the steps necessary to produce an executable file, including writing source code, compilation, linking, and testing. Additionally, it explains the roles of compilers and linkers, along with the files they require for operation.

Uploaded by

qw7dbcvd7x
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

Practical # 01

Introduction to DEV C++ IDE

Objective: To understand the DEV C++ IDE(Integrated Development Environment)


and implement a simple C Program. Theory:

The Integrated Development Environment (IDE)


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.
Installation Steps:
1. Download the installer from the internet. Follow the instructions and install the
program. The following screenshots will help you install and run the product:

2. License Agreement
Click on the "I Agree" button to continue
3. Choose Components
Make sure that the type of install is Full and click the Next button to continue

4. Choose Install Location


Click the Install button to continue
5. Installing Click the Yes button

6. Finished
Click the Finish button to finalize the installation and run the program.

7. First Time Configuration


Click the Next button to continue
8. First Time Configuration
Click the Next button to continue

9. First Time Configuration


Wait for the Progress Bar to Complete
10. First Time Configuration
Click the OK button to Finalize

New Project Menu


Click the File menu, then select the New menu item and click the Project menu item.
New Project
On the top, make sure that Basic tab is selected and under the Basic tab, select “Console
Application”
Give a name to your project using the Name text box, For instance, “Hello World”.
Important: Choose “C Project” under “Project Options”, on the left
Click the OK button to create your project

Create New Project


Give a name to your project file and click the Save button to continue
Compile & Run:
Click “Compile & Run” menu item or the icon displayed in the below screenshot or just
Press F9 to compile and run your program.

Running:
Assuming you did not make any syntax errors on your code, you should see a similar output
window running your program.
Compile Failed
If you try to compile a code which has syntax errors, Compiler window lists the errors
with their line numbers. You can double click the error and see the error highlighted in
the code.
QUESTION NO 1:
DISCUAS THE NECESSORY TO PRODUCE EXECUTABLE FILE ?
Step 1: Writing the Source Code

1. Choose a programming language (e.g., C, C++, Java, Python).


2. Write the source code using a text editor or Integrated Development
Environment (IDE).
3. Save the source code file with the appropriate extension (e.g., .c, .cpp, .java,
.py).

Step 2: Compilation (if necessary)

1. If using a compiled language (e.g., C, C++), compile the source code into
object code using a compiler (e.g., gcc, clang).
2. The compiler checks for syntax errors and generates object code.

Step 3: Linking

1. Link the object code files together to create a single executable file.
2. The linker resolves external references and libraries.
3. Static linking: libraries are embedded into the executable.
4. Dynamic linking: libraries are loaded at runtime.

Step 4: Assembly (if necessary)

1. If using assembly language, assemble the source code into machine code.
2. The assembler converts symbolic code into binary code.

Step 5: Packaging

1. Package the executable file with any necessary dependencies (e.g., libraries,
configuration files).
2. Create an installer or package manager (e.g., .exe, .msi, .deb, .rpm).

Step 6: Testing and Debugging

1. Test the executable file for functionality and errors.


2. Debug any issues found during testing.
Step 7: Finalization

1. Obfuscate or encrypt the executable file (optional).


2. Digitally sign the executable file (optional).
3. Prepare the executable file for distribution.

Tools involved:

1. Text editors (e.g., Notepad++, Sublime Text)


2. Integrated Development Environments (e.g., Visual Studio, Eclipse)
3. Compilers (e.g., gcc, clang)
4. Linkers (e.g., ld, link)
5. Assemblers (e.g., NASM, MASM)
6. Package managers (e.g., pip, npm)
7. Installers (e.g., InstallShield, Inno Setup)

Output:

1. Executable file (e.g., .exe, .elf, .macho)


2. Library files (e.g., .dll, .so, .dylib)
3. Configuration files (e.g., .ini, .config)
4. Installation package (e.g., .msi, .deb, .rpm)

QUESTION NO 2:
Discuss the purpose of compiler and the file needed by compiler?
Purpose of a Compiler:

A compiler is a complex software program that plays a crucial role in the


development and execution of computer programs. The primary purpose of a
compiler is to translate source code written in a high-level programming language
(such as C, C++, Java, or Python) into machine code that can be executed directly by
the computer's processor.

The key objectives of a compiler are:


1. Translation: Convert high-level code into machine-specific assembly code or
machine code.
2. Error Detection: Identify and report errors in the source code, such as syntax
errors, semantic errors, or type errors.
3. Code Optimization: Improve the efficiency and performance of the generated
machine code.
4. Platform Independence: Allow source code to be compiled on different platforms,
ensuring portability.

Files Needed by a Compiler:

To perform its tasks, a compiler typically requires the following files:

1. Source Code File (e.g., .c, .cpp, .java, .py): The high-level program written by the
programmer.
2. Header Files (e.g., .h, .hpp): Contain function declarations, macro definitions, and
type definitions.
3. Library Files (e.g., .lib, .a): Pre-compiled code libraries that provide additional
functionality.
4. Include Files (e.g., .inc): Supplementary files included in the source code using
preprocessor directives.
5. Linker Script Files (e.g., .ld): Define how the compiled object files should be linked
together.
6. Configuration Files (e.g., Makefile): Specify compiler options, include paths, and
library dependencies.
7. Object Files (e.g., .o, .obj): Intermediate files generated by the compiler, containing
machine code.

QUESTION NO 3:
Discus the linker and the file needed by linker?
A linker, also known as a linker editor or ld, is a computer program that takes object
files generated by a compiler and combines them into a single executable file that
can be run on a computer. The linker resolves external references between object
files and libraries, allowing the program to use functions and variables defined
elsewhere.

File Needed by the Linker:

To perform its task, the linker requires the following files:

1. Object files (.obj, .o): These are the compiled output files generated by the
compiler (e.g., gcc). Each object file contains machine code for a specific source file.
2. Library files (.lib, .a, .so): These files contain compiled code that provides a set of
functions or services that can be used by multiple programs. Libraries can be either
static or dynamic.
- Static libraries (.lib, .a): contain object code that is linked into the executable file.
- Dynamic libraries (.so, .dll): contain object code that is linked at runtime.
3. Header files (.h, .hpp): Although not directly used by the linker, header files
provide function declarations and macro definitions that help the linker resolve
external reference

LAB ASSINGMENT NO 1: COMPUTER


FUNDAMENTAL
:ROLL NO: 24AI28
TEACHER NAME: SIR OWAIS REHMANI
DATE:27:10:2024

You might also like