1
00:00:04,610 --> 00:00:07,910
Hey welcome I hope you'll remember this program.

2
00:00:07,910 --> 00:00:14,580
I already have executed this program while downloading and installing various IDs in the previous section.

3
00:00:14,630 --> 00:00:18,120
If you missed that just go ahead and run this once more.

4
00:00:18,290 --> 00:00:20,440
The purpose of this program is pretty simple.

5
00:00:20,450 --> 00:00:23,080
It's going to print hello world into the console.

6
00:00:23,310 --> 00:00:24,650
OK so here we go.

7
00:00:24,830 --> 00:00:26,630
I'll just run this once more.

8
00:00:26,690 --> 00:00:27,830
Click on build canals.

9
00:00:27,860 --> 00:00:29,790
Click on it then run.

10
00:00:29,840 --> 00:00:33,800
If you are using X code on math Carvey's will suit you.

11
00:00:33,800 --> 00:00:39,800
And please few the appropriate tutorial in the previous section to get the idea how to run programs

12
00:00:40,010 --> 00:00:41,520
within those environments.

13
00:00:41,630 --> 00:00:43,840
So I'll use code loss in this tutorial.

14
00:00:43,850 --> 00:00:45,350
So here we go.

15
00:00:45,450 --> 00:00:46,800
We can build and run.

16
00:00:46,940 --> 00:00:48,820
And here's the output.

17
00:00:48,860 --> 00:00:51,590
You say that hello world is printed on the console.

18
00:00:51,770 --> 00:00:53,270
So that's the purpose of this program.

19
00:00:53,270 --> 00:00:59,900
Pretty simple but you need to understand this program clearly in order to go ahead and start learning

20
00:00:59,900 --> 00:01:03,660
C++ because everything starts with this program.

21
00:01:03,800 --> 00:01:08,620
Before I go ahead and explain everything of this program I'd like to ask you a question.

22
00:01:08,660 --> 00:01:14,100
Do you know who or what practical executes our program on the machine.

23
00:01:14,510 --> 00:01:18,820
It's the operating system Windows Linux on Mac.

24
00:01:19,060 --> 00:01:23,570
Now the operating system is the manager not the hardware it manages the hardware.

25
00:01:23,570 --> 00:01:28,990
We just don't interact with the hardware when we create our program in order to execute the program

26
00:01:29,000 --> 00:01:33,280
the program will need memory to lead processor.

27
00:01:33,380 --> 00:01:39,590
It will need audio devices so all these hardware components are going to be required by the problem

28
00:01:39,590 --> 00:01:41,300
for proper execution.

29
00:01:41,300 --> 00:01:46,940
Now these hardware resources are managed by the operating system with only to interact with the hardware

30
00:01:47,000 --> 00:01:47,780
directly.

31
00:01:48,080 --> 00:01:52,940
So is the operating system that to care for the execution of our program.

32
00:01:52,940 --> 00:01:57,830
We just need to submit our program to the operating system and the rest of the responsibility for execution

33
00:01:57,830 --> 00:02:01,380
of the problem lies on the shoulder of the operating system.

34
00:02:01,440 --> 00:02:10,800
So Gerty's we have hardware right past the hardware component hardware layer in our machine but that

35
00:02:10,820 --> 00:02:17,140
is abstracted either operating system or s like Windows or Linux or Mac.

36
00:02:17,390 --> 00:02:24,650
So we always interact with the operating system and this operating system executes our program.

37
00:02:24,650 --> 00:02:31,730
But the problem is that none of the operating systems are actually recognizes any of the programming

38
00:02:31,730 --> 00:02:32,840
languages.

39
00:02:32,840 --> 00:02:40,140
So what happens if we submit the C++ program directly to the operating system as it is right now here.

40
00:02:40,430 --> 00:02:46,130
The operating system is going to recognize this as a text file and it's not going to recognize this

41
00:02:46,220 --> 00:02:49,520
as a program so it's not needed to get this one.

42
00:02:50,000 --> 00:02:56,870
So what you need to do is to translate this program that you have written in C++ to operating system

43
00:02:56,900 --> 00:02:58,520
understandable format.

44
00:02:58,910 --> 00:03:01,930
And here comes that is far less of compiler.

45
00:03:02,000 --> 00:03:07,550
The purpose of the compiler is to translate the source code that we have written in some language some

46
00:03:07,550 --> 00:03:12,410
high level language like C++ or C to the operating system understandable format.

47
00:03:12,410 --> 00:03:13,610
It happens in this way.

48
00:03:13,780 --> 00:03:22,230
We will actually submit our source code that is maned RCP here do the C++ compiler C compiler.

49
00:03:22,250 --> 00:03:27,910
Because our language is C++ and the C++ compiler.

50
00:03:28,100 --> 00:03:35,150
Thus it produces a translated file that is operating system understandable format that atypically car

51
00:03:35,360 --> 00:03:38,920
object file that contains object code.

52
00:03:39,260 --> 00:03:46,730
So the output of this compiler is going to be main dot all as the object file that is going to be created

53
00:03:46,730 --> 00:03:47,770
by the compiler.

54
00:03:48,050 --> 00:03:51,500
Obviously compiler needs the source code error free.

55
00:03:51,500 --> 00:03:55,370
That means he should not have any kind of syntax error in the source code.

56
00:03:55,370 --> 00:04:01,110
You should get semi-colons properly or the braces properly or a MUST use the keywords appropriately.

57
00:04:01,160 --> 00:04:04,610
In that case only the compiler is going to compile your source code.

58
00:04:04,610 --> 00:04:11,720
Otherwise if the compiler finds anything that error in the source file is going to generate it at least

59
00:04:11,870 --> 00:04:17,720
with the line number and brief description and you'd require to rectify all those errors and correct

60
00:04:17,720 --> 00:04:21,850
them before it could submit your file for recompilation.

61
00:04:21,860 --> 00:04:26,580
So once that compilation is done successfully this object file is going to be created.

62
00:04:26,630 --> 00:04:30,120
Now what happens in real life in a single program.

63
00:04:30,130 --> 00:04:34,730
It may have several files in a single software or application.

64
00:04:34,730 --> 00:04:39,590
You may have several source files you may have named or CPV as one file.

65
00:04:39,620 --> 00:04:46,520
You may have funded CBT and either one because we are going to modernize our program we'll have different

66
00:04:46,520 --> 00:04:52,630
model written in different files and ima have another one set called R.S.V.P..

67
00:04:52,790 --> 00:04:54,990
So all these are part of the same program.

68
00:04:55,040 --> 00:05:02,120
OK so now what happens when you want to actually build the executable you need to compile all these

69
00:05:02,120 --> 00:05:03,760
files in it.

70
00:05:04,380 --> 00:05:10,170
All these files to the compiler and compiler is going to try to use object code for each of these files.

71
00:05:10,170 --> 00:05:17,130
So far maned actually Pippy it to create main guggle for fundit say BP is going to create fund all and

72
00:05:17,130 --> 00:05:20,780
for all that CPB is going to create all involved.

73
00:05:21,000 --> 00:05:23,570
So all these object files will be there.

74
00:05:23,700 --> 00:05:29,880
Now what you need is a single executable that we need to bundle together all the object files in a single

75
00:05:29,970 --> 00:05:31,130
executable file.

76
00:05:31,410 --> 00:05:34,130
And for that there is build mutuality.

77
00:05:34,470 --> 00:05:41,220
So we will actually invoke the believe to duty after that and this build if that is going to combine

78
00:05:41,280 --> 00:05:42,900
all these things all banded together.

79
00:05:42,900 --> 00:05:46,770
All these things into a single executable unit.

80
00:05:47,050 --> 00:05:55,140
Now you might use some library functions in your program Aspel the library utilities contains many utility

81
00:05:55,140 --> 00:05:58,860
functions in C++ or in Java or in C..

82
00:05:58,890 --> 00:06:04,710
You are having a rich set of libraries where many functionalities classes types are already involved

83
00:06:05,160 --> 00:06:11,130
so that you can get that job and quickly so you can use some of the library utilities in your program

84
00:06:11,520 --> 00:06:12,550
to do the job.

85
00:06:12,750 --> 00:06:19,020
So if you have done so then that builder is going to inject that library utilities with the executable

86
00:06:19,080 --> 00:06:25,110
as well because when the program is going to be executed at the library utility has to be there within

87
00:06:25,110 --> 00:06:34,320
the executable so it injects all those things in a single executable it and produces that you see for

88
00:06:34,380 --> 00:06:35,330
Windows.

89
00:06:35,340 --> 00:06:43,060
So if your product name is first a b like this one then that executable is going to be first KPP that

90
00:06:43,260 --> 00:06:45,500
actually for Windows platform.

91
00:06:45,690 --> 00:06:54,360
If you are using Linux or Mac is going to be first Peepy got how to ask the executable for Linux on

92
00:06:54,360 --> 00:06:55,580
a Mac platform.

93
00:06:55,950 --> 00:07:04,200
So now if you take this you see to any Windows system and it's going to run them.

94
00:07:04,380 --> 00:07:09,250
If you take this first Abdur out to any Linux system it's going to run.

95
00:07:09,360 --> 00:07:13,130
So that's how this executable is created.

96
00:07:13,440 --> 00:07:18,510
Now when you are using IDS like this one is called Lost and what happens when you are clicking this

97
00:07:18,690 --> 00:07:23,470
failed and run here all these things are happening behind the screen.

98
00:07:23,490 --> 00:07:31,990
Please remember one more thing that this ID is not a compiler compiler is a separate entity and this

99
00:07:32,050 --> 00:07:36,050
ID is only a smart editor.

100
00:07:36,080 --> 00:07:36,700
OK.

101
00:07:36,700 --> 00:07:41,470
So when you are clicking on that build and run it's actually invoking the compiler first.

102
00:07:41,590 --> 00:07:47,590
That's going to happen with all files the object files and then it's going to be it's going to call

103
00:07:47,590 --> 00:07:48,300
the builder.

104
00:07:48,490 --> 00:07:50,670
That's going to build that EFC.

105
00:07:50,710 --> 00:07:51,670
So that is happening.

106
00:07:51,700 --> 00:07:54,020
All those things are happening behind the screen.

107
00:07:54,070 --> 00:07:54,860
I'll show you that.

108
00:07:54,880 --> 00:07:55,810
Let me just show you that.

109
00:07:55,840 --> 00:07:56,110
OK.

110
00:07:56,110 --> 00:07:57,190
I'll go to the folder.

111
00:07:57,190 --> 00:08:01,690
Here is the project folder first AP that I have saved here in this spot.

112
00:08:02,170 --> 00:08:07,850
And if I go inside this process folder you can see that this maned R.S.V.P. is our source file.

113
00:08:08,140 --> 00:08:11,370
And we didn't deposit folder we have two folders there.

114
00:08:11,380 --> 00:08:14,050
One is this all Widger and of that is this been.

115
00:08:14,170 --> 00:08:17,080
If I go inside this showbizzy I'll find another folder.

116
00:08:17,080 --> 00:08:18,180
That's a bag.

117
00:08:18,400 --> 00:08:22,290
And inside of this debug folder you can see that object file is there.

118
00:08:22,360 --> 00:08:26,920
So this OPG slash D-bag is the home for the object files.

119
00:08:26,920 --> 00:08:28,870
Now let me show you the other one.

120
00:08:28,870 --> 00:08:30,060
This bin folder.

121
00:08:30,280 --> 00:08:33,670
Now if I go inside this pin I'll find another D-bag.

122
00:08:33,820 --> 00:08:37,520
And inside this D-bag you can see that the executable is there.

123
00:08:37,780 --> 00:08:40,860
So this Bindy bag is the home for the executable.

124
00:08:40,960 --> 00:08:47,810
When we click on this field and it can run the compiler compiles this program Missippi be fine.

125
00:08:47,920 --> 00:08:54,310
And it actually produces the old file inside that or we check it back and then the build comes into

126
00:08:54,310 --> 00:08:54,840
play.

127
00:08:54,940 --> 00:08:59,890
And that is the single executable by finding all those Optik files.

128
00:08:59,890 --> 00:09:01,680
So I'll show you that on the fly.

129
00:09:01,720 --> 00:09:03,580
Let me just delete all these things.

130
00:09:05,390 --> 00:09:12,930
OK I'll delete that object file as well and I'll open two views of the same folders.

131
00:09:13,060 --> 00:09:17,450
OK the bottom one is that bin debug and the top one is that or which at the back.

132
00:09:17,450 --> 00:09:23,040
Now I'll just hit that build and build and run and you'll see that of that fight.

133
00:09:23,060 --> 00:09:24,610
Those files are created there.

134
00:09:24,610 --> 00:09:25,610
Here it is.

135
00:09:25,640 --> 00:09:28,170
You can see that the first after the X is created here.

136
00:09:28,310 --> 00:09:31,720
And the main door is created there on the object the back.

137
00:09:32,030 --> 00:09:34,740
So that's how all the things happens behind the screen.

138
00:09:34,970 --> 00:09:36,180
I hope you have enjoyed this.

139
00:09:36,230 --> 00:09:39,250
I'll just not make it more lengthy in the next tutorial.

140
00:09:39,260 --> 00:09:43,000
I'm going to explain this first problem to you.

141
00:09:43,160 --> 00:09:46,340
OK so I'll explain why this is Main.

142
00:09:46,350 --> 00:09:51,530
What's the meaning of that and why but what's the purpose of this hashing include ice cream.

143
00:09:51,560 --> 00:09:53,940
What's the purpose of this let's understand the C out.

144
00:09:54,020 --> 00:09:56,040
I'll explain everything in the next tutorial.

145
00:09:56,120 --> 00:09:57,290
So stay tuned.

