1 00:00:05,400 --> 00:00:06,400 Hello everyone. 2 00:00:06,400 --> 00:00:09,400 In this video, we're going to configure CodeLite 3 00:00:09,400 --> 00:00:13,400 to work with the C++ compiler on Ubuntu Linux. 4 00:00:13,400 --> 00:00:17,090 I'm running Ubuntu 22.04, which is Jemmy. 5 00:00:17,090 --> 00:00:18,650 I've already opened CodeLite. 6 00:00:18,650 --> 00:00:20,650 And the first time you run CodeLite, 7 00:00:20,650 --> 00:00:25,150 you're going to get a setup wizard pop up window that pops up just like this. 8 00:00:25,150 --> 00:00:28,750 If you don't get that, you can always go to help and run it from there. 9 00:00:29,550 --> 00:00:32,549 We do want to run this setup wizard, so I'm going to click next. 10 00:00:34,150 --> 00:00:38,550 I'm going to click C++ development and click next again. 11 00:00:39,910 --> 00:00:44,110 And I'm going to ask CodeLite to scan my system to find compilers. 12 00:00:44,990 --> 00:00:47,590 I'll click that button and you can see it found GCC 11, 13 00:00:47,590 --> 00:00:49,590 which was the compiler that we installed. 14 00:00:49,590 --> 00:00:51,590 Now, I'm going to rename that to just GCC, 15 00:00:51,590 --> 00:00:54,950 that way it's consistent throughout the course but I'll do that in just a moment. 16 00:00:54,950 --> 00:00:55,950 I'll select next here, 17 00:00:57,300 --> 00:01:00,990 you can choose the color whether you want a dark theme or a Light theme. 18 00:01:00,990 --> 00:01:03,990 I generally use a dark theme, but I think the Light theme shows up 19 00:01:03,990 --> 00:01:07,290 better on video, so I'm just going to leave this alone and I'll select Next. 20 00:01:08,090 --> 00:01:10,090 And on this screen, just click Finish. 21 00:01:12,390 --> 00:01:15,390 Okay, so CodeLite will close down and open back up. 22 00:01:16,290 --> 00:01:17,490 And now, what we want to do is? 23 00:01:17,490 --> 00:01:21,790 We want to setup the compiler and we're just going to change the name. 24 00:01:21,790 --> 00:01:24,790 So I'm going to come up to Settings and go to Build Settings 25 00:01:24,790 --> 00:01:27,290 and there you can see GCC right here. 26 00:01:27,290 --> 00:01:31,290 So I'm just going to right click and rename and I'm just going to call it GCC, 27 00:01:32,090 --> 00:01:33,090 just like that. 28 00:01:33,090 --> 00:01:34,450 And I'll hit OK. 29 00:01:35,250 --> 00:01:35,850 Perfect. 30 00:01:35,850 --> 00:01:38,850 Now, what we want to do is? We want to create workspaces. 31 00:01:40,350 --> 00:01:42,950 The way CodeLite works is it's got workspaces. 32 00:01:42,950 --> 00:01:45,950 And then in those workspaces, you can have many projects, 33 00:01:45,950 --> 00:01:48,750 each project being a C++ program. 34 00:01:48,750 --> 00:01:51,550 So, it's a real nice way to organize your work. 35 00:01:51,550 --> 00:01:55,550 The first thing we want to do is, we want to create a new workspace, 36 00:01:55,550 --> 00:01:56,910 now there's a lot of ways to do that. 37 00:01:56,910 --> 00:01:59,910 I can click this big button right here, right in front of me, 38 00:01:59,910 --> 00:02:03,910 I can also come up to workspace, new workspace and I can go to file, 39 00:02:03,910 --> 00:02:05,410 new workspace over here. 40 00:02:06,210 --> 00:02:09,509 A lot of different ways to do it, I'm going to just click this button right here. 41 00:02:10,870 --> 00:02:14,670 Now, I'm going to select the C++ Workspace and click OK. 42 00:02:15,270 --> 00:02:18,570 Now it's going to ask me, where do you want to store your workspaces? 43 00:02:18,570 --> 00:02:20,870 You've got some choices here, you can put them on your desktop, 44 00:02:20,870 --> 00:02:22,560 you can put them in your documents folder. 45 00:02:22,560 --> 00:02:25,560 I'm going to put it right off of my home directory 46 00:02:25,560 --> 00:02:28,160 right there and I'm going to create a folder there. 47 00:02:28,520 --> 00:02:32,620 Let me click over here to create the folder and I'm going to call it Workspaces. 48 00:02:33,980 --> 00:02:36,780 So I can create as many workspaces as I want in here and then 49 00:02:36,780 --> 00:02:39,080 projects within each of those workspaces 50 00:02:39,080 --> 00:02:42,080 and I can have everything nicely organized, so I'm going to click create 51 00:02:42,580 --> 00:02:43,940 and I'll hit open. 52 00:02:44,300 --> 00:02:47,300 So now, you can see that the workspace path is my 53 00:02:47,300 --> 00:02:49,800 home directory followed by workspaces. 54 00:02:49,800 --> 00:02:53,300 And the workspace name is going to be workspace One 55 00:02:53,300 --> 00:02:53,990 or whatever you like. 56 00:02:53,990 --> 00:02:57,680 When you're working on pointers, maybe you want a pointer as workspace and so forth. 57 00:02:57,680 --> 00:03:01,780 And make sure that the workspace under a separate directory is checked 58 00:03:01,780 --> 00:03:03,780 and I'm going to click OK. 59 00:03:03,780 --> 00:03:05,140 And that will create my workspace. 60 00:03:05,140 --> 00:03:08,340 And you can see it right over here on the workspace view, you can see 61 00:03:08,340 --> 00:03:09,640 the workspace one. 62 00:03:10,000 --> 00:03:11,200 Now, what we want to do is? 63 00:03:11,200 --> 00:03:13,400 Create projects within that workspace. 64 00:03:13,400 --> 00:03:17,300 So I can right click on the Workspace One and create a new project. 65 00:03:17,300 --> 00:03:20,300 Or I can come up to file new project. 66 00:03:20,300 --> 00:03:22,300 Again, a lot of different ways to do it, 67 00:03:22,300 --> 00:03:24,800 I'm just going to right click here and say new Project. 68 00:03:25,680 --> 00:03:28,370 And now, we get this new project wizard. 69 00:03:28,370 --> 00:03:31,370 We know that the path is that Workspace One folder, 70 00:03:31,370 --> 00:03:32,370 that's where my workspace is. 71 00:03:32,370 --> 00:03:34,570 Now, it's asking us for the project name. 72 00:03:34,570 --> 00:03:38,570 I'm just going to call it Project One, just like that. 73 00:03:38,570 --> 00:03:42,070 Very important, I'm going to probably say this more times than you want to hear it, 74 00:03:42,070 --> 00:03:43,370 but it's very important. 75 00:03:43,370 --> 00:03:47,370 No spaces, no special characters, no international characters anywhere. 76 00:03:47,670 --> 00:03:50,870 So, don't start putting plus symbols and dots and slashes 77 00:03:50,870 --> 00:03:52,570 and dollar signs in these names 78 00:03:52,570 --> 00:03:55,470 because that will usually mess up the builds later. 79 00:03:55,470 --> 00:03:57,830 So, just keep them really simple, 80 00:03:57,830 --> 00:04:01,430 make sure that they create the project in its own folder is checked. 81 00:04:02,120 --> 00:04:05,120 Now, the category we're going to select is console 82 00:04:05,120 --> 00:04:08,420 because we're going to be creating console based applications. 83 00:04:08,420 --> 00:04:13,110 The type is going to be simple executable G++ right here, 84 00:04:14,910 --> 00:04:19,010 The compiler is GCC that the one we just installed and renamed. 85 00:04:20,410 --> 00:04:22,410 The Debugger is the GNU 86 00:04:22,410 --> 00:04:24,410 GDB debugger, we only have one option here. 87 00:04:25,410 --> 00:04:30,610 And the build system, we've got two options, we're going to select CodeLite make file generator. 88 00:04:30,610 --> 00:04:34,110 I'm installing version 17.3 of CodeLite. 89 00:04:34,110 --> 00:04:38,010 Previous versions had a default build system, it was called Default 90 00:04:38,010 --> 00:04:39,010 and it worked great. 91 00:04:39,010 --> 00:04:41,010 But in this version and going forward, 92 00:04:41,010 --> 00:04:44,700 the CodeLite developer removed that default build system, 93 00:04:44,700 --> 00:04:47,390 I don't know why did that, but we have to deal with it. 94 00:04:47,390 --> 00:04:51,190 So, we'll make a few adjustments to the way we create new projects but it's pretty easy. 95 00:04:51,550 --> 00:04:55,350 Once we have all that, make sure all this is correct, 96 00:04:55,350 --> 00:04:59,150 you click OK and you can see now that we've got a new project over here, Project One. 97 00:04:59,150 --> 00:05:03,950 And it's got a source folder and it's got my main.cpp file in it. 98 00:05:03,950 --> 00:05:06,950 The main.cpp file is our source code. 99 00:05:07,750 --> 00:05:10,450 Now, I'm going to make this a little bit bigger, so I'm going to go to settings, 100 00:05:10,450 --> 00:05:13,650 colors and fonts and I'm just going to create 101 00:05:13,650 --> 00:05:16,250 maybe a, let's see, 102 00:05:17,050 --> 00:05:21,050 we can set that to 20 that should be nice and big so it shows up good on video. 103 00:05:21,850 --> 00:05:24,450 And I'll select that and apply and then hit OK. 104 00:05:25,140 --> 00:05:27,340 All right, so now, the font is nice and large. 105 00:05:27,340 --> 00:05:30,140 So, first thing we're going to do is, we're going to delete this. 106 00:05:30,140 --> 00:05:32,640 I'm just going to copy it all and just press delete. 107 00:05:33,540 --> 00:05:36,340 Now you can see over here you have this black dot 108 00:05:36,340 --> 00:05:39,640 that's telling you that this file has been changed. 109 00:05:39,640 --> 00:05:42,440 So that what's on disk is different from what you're seeing. 110 00:05:42,440 --> 00:05:44,440 Makes sense because we just deleted a bunch of stuff. 111 00:05:44,840 --> 00:05:46,740 So, we want to be sure that, 112 00:05:46,740 --> 00:05:49,540 whenever we see that, we save when we're done. 113 00:05:49,540 --> 00:05:51,740 So, first thing we're going to do is, we're going to type in 114 00:05:51,740 --> 00:05:54,940 a real simple Hello World C++ program. 115 00:05:54,940 --> 00:05:57,820 The reason we do this is because it's simple 116 00:05:57,820 --> 00:06:00,420 and if it runs and we see Hello World, 117 00:06:00,420 --> 00:06:03,220 we know that our development environment is set up correctly, 118 00:06:03,220 --> 00:06:04,720 so that's the reason for doing it. 119 00:06:04,720 --> 00:06:07,410 At this point, just type along, follow along, 120 00:06:07,410 --> 00:06:09,610 all the C++ will be explained later. 121 00:06:09,610 --> 00:06:13,810 The point of this video is to make sure that our development environment is set up correctly. 122 00:06:13,810 --> 00:06:17,110 So, I'm going to type pound, include 123 00:06:18,710 --> 00:06:22,610 space left angle bracket, io stream, 124 00:06:23,210 --> 00:06:25,210 and right-angle bracket. 125 00:06:25,210 --> 00:06:27,210 Then I'm going to type using 126 00:06:27,710 --> 00:06:29,210 namespace 127 00:06:29,210 --> 00:06:31,760 std semicolon, 128 00:06:31,760 --> 00:06:33,450 there's spaces between using 129 00:06:33,450 --> 00:06:36,650 and the namespace and namespace and standard. 130 00:06:37,550 --> 00:06:39,550 Now, I want to write my main function. 131 00:06:39,550 --> 00:06:42,150 Every C++ program has a main function 132 00:06:42,150 --> 00:06:43,950 and that's where execution begins. 133 00:06:43,950 --> 00:06:46,950 So let's do that, we'll type int, int 134 00:06:46,950 --> 00:06:48,850 space main, 135 00:06:49,540 --> 00:06:51,540 left Paren, right paren. 136 00:06:51,540 --> 00:06:53,900 And then we have an open curly brace 137 00:06:53,900 --> 00:06:57,600 and you'll notice that CodeLite automatically closed the right 138 00:06:57,600 --> 00:06:58,900 curly brace for me, 139 00:06:58,900 --> 00:07:00,150 so that way they match. 140 00:07:00,150 --> 00:07:03,350 Make sure you spell main correctly, make sure those are parentheses, 141 00:07:03,350 --> 00:07:06,550 make sure you've got spaces where I have spaces and so forth. 142 00:07:07,240 --> 00:07:10,240 Okay, so now, I'm just going to tab over and I'm going to type c out, 143 00:07:11,040 --> 00:07:12,240 two 144 00:07:12,240 --> 00:07:15,740 left angle brackets side by side, no space between them 145 00:07:16,140 --> 00:07:17,740 and Hello World 146 00:07:21,240 --> 00:07:23,840 and I want that within double quotes, 147 00:07:24,830 --> 00:07:27,130 two left angle brackets again and then, 148 00:07:27,130 --> 00:07:30,330 the word endl for end line. 149 00:07:30,330 --> 00:07:33,130 Make sure that's endl and not end1, the l 150 00:07:33,130 --> 00:07:35,130 and the 1 look really similar. 151 00:07:35,130 --> 00:07:38,930 Then I'm going to return space zero and a semicolon. 152 00:07:39,620 --> 00:07:40,520 That's it. 153 00:07:40,520 --> 00:07:42,120 That's our simple main. 154 00:07:42,120 --> 00:07:45,120 When we run it, we should see Hello World display on the terminal. 155 00:07:45,620 --> 00:07:50,220 But before we run it, we need to configure this project and give it a few compiler settings. 156 00:07:50,220 --> 00:07:54,210 First thing, though, is let's save this, so you can come up here to file, 157 00:07:54,210 --> 00:07:58,210 save file or you can press CTRL S, I'm going to press CTRL S 158 00:07:58,210 --> 00:08:00,420 and you can see that black dot is gone, 159 00:08:00,420 --> 00:08:02,020 it might be a red dot on your system. 160 00:08:02,020 --> 00:08:04,710 It was a red dot in my other system, but it's a black dot here. 161 00:08:04,710 --> 00:08:07,010 In any case, you're going to see that dot there 162 00:08:07,010 --> 00:08:08,210 when the file is dirty. 163 00:08:08,210 --> 00:08:10,210 In other words, when it hasn't been saved. 164 00:08:10,210 --> 00:08:12,760 When I've made some changes, but I haven't saved them to disk yet. 165 00:08:13,450 --> 00:08:15,810 Okay, so now, let's set up the project. 166 00:08:15,810 --> 00:08:17,610 I'm going to right click on the project 167 00:08:18,410 --> 00:08:19,910 and select Settings. 168 00:08:19,910 --> 00:08:23,900 You can also just click on the project and select this wrench right up here, 169 00:08:23,900 --> 00:08:24,900 does the same thing. 170 00:08:26,500 --> 00:08:30,000 At this point, my project settings window opens. 171 00:08:30,800 --> 00:08:34,100 And let's go through this, the project type is executable. 172 00:08:34,100 --> 00:08:39,090 The make file generator is CodeLite make file generator, the compiler is GCC. 173 00:08:39,090 --> 00:08:43,090 The intermediate directory is blank, the output file says Project name. 174 00:08:43,090 --> 00:08:46,690 And sometimes, you need to stretch this out, just a little bit 175 00:08:46,690 --> 00:08:48,380 to see more stuff. 176 00:08:48,380 --> 00:08:51,380 And I think that doesn't happen on Windows or Mac, 177 00:08:51,380 --> 00:08:54,380 but it does happen on Linux sometimes, let me stretch that out a little bit. 178 00:08:54,740 --> 00:08:57,100 So, all of this is the stuff that we put in earlier. 179 00:08:57,100 --> 00:09:01,460 There's one thing that's really important is this one right here, the working directory. 180 00:09:01,460 --> 00:09:03,960 We want to delete that the entire line 181 00:09:05,650 --> 00:09:08,340 and we want to replace it with dollar, 182 00:09:08,340 --> 00:09:12,740 left parentheses, project path, 183 00:09:12,740 --> 00:09:14,100 right parentheses 184 00:09:14,100 --> 00:09:17,900 where the p in project and the p and path are uppercase, 185 00:09:17,900 --> 00:09:19,260 that's really important. 186 00:09:19,260 --> 00:09:20,760 Okay, that's the first part. 187 00:09:20,760 --> 00:09:25,010 The second part is, I'm going to come over here to my compiler, click compiler 188 00:09:25,010 --> 00:09:29,210 and right up here where it says CC++ compiler, I'm going to click that line 189 00:09:29,210 --> 00:09:33,810 and you can see these little button shows up with three dots in it, I'm going to click that. 190 00:09:34,710 --> 00:09:38,210 Then I'm going to come over here in the compiler options and I want to choose 191 00:09:38,210 --> 00:09:41,410 enable C++ 17 features. 192 00:09:41,410 --> 00:09:44,510 This one right here, enable C++ 17 features, 193 00:09:44,510 --> 00:09:47,010 std equals C++ 17. 194 00:09:47,700 --> 00:09:51,600 That will tell CodeLite to use the C++ version of the compiler. 195 00:09:51,600 --> 00:09:52,900 That's it, we're done. 196 00:09:52,900 --> 00:09:55,800 We'll click OK, we'll click apply 197 00:09:55,800 --> 00:09:57,800 and we'll click OK one more time. 198 00:09:57,800 --> 00:09:59,300 At this point, we are good to go. 199 00:09:59,300 --> 00:10:01,500 Now, I'm going to make this full screen here, 200 00:10:01,500 --> 00:10:04,100 so that we have a little bit more room to see what's happening. 201 00:10:04,100 --> 00:10:06,300 Now, we're ready to build our project. 202 00:10:06,300 --> 00:10:07,900 The way that CodeLite works, 203 00:10:07,900 --> 00:10:11,100 since it can have multiple projects in this workspace here, 204 00:10:11,100 --> 00:10:14,300 of course we only have one right now, we'll create another one in just a moment. 205 00:10:14,900 --> 00:10:18,200 It builds and runs the active project 206 00:10:18,200 --> 00:10:23,190 and you can see the active project right there, it's bold and it's italicized. 207 00:10:23,190 --> 00:10:27,180 So if I have a bunch of projects there's only going to be one that's bold and italicized 208 00:10:27,180 --> 00:10:29,870 and that's considered the active project. 209 00:10:29,870 --> 00:10:32,750 To make a project, the active project, 210 00:10:32,750 --> 00:10:36,750 you can select it, right click on it and then come down here to make active 211 00:10:36,750 --> 00:10:40,750 or you could just double click on it, simple as that. 212 00:10:40,750 --> 00:10:42,250 Now, we're ready to build this. 213 00:10:42,250 --> 00:10:43,850 So, we're going to come up to build 214 00:10:44,350 --> 00:10:46,450 and I'm going to select rebuild project and I'll 215 00:10:46,450 --> 00:10:49,440 talk about all of the differences here in a future video, 216 00:10:49,440 --> 00:10:51,040 I'm going to select rebuild project. 217 00:10:51,730 --> 00:10:54,420 And the output window shows up down at the bottom, 218 00:10:54,420 --> 00:10:56,620 I'll stretch this out so it's a little bit bigger. 219 00:10:56,620 --> 00:10:59,920 And you can see right here we're using the C++ compiler, 220 00:10:59,920 --> 00:11:03,220 we're building project one main CPP, 221 00:11:03,220 --> 00:11:07,020 we've got std equals C++ 17and all the stuff that we typed in, 222 00:11:07,020 --> 00:11:08,320 so this is great. 223 00:11:08,320 --> 00:11:11,620 We have a successful build, no errors, no warnings. 224 00:11:11,620 --> 00:11:13,420 Now, I can run my program. 225 00:11:13,420 --> 00:11:16,720 So let me close this up, again to give us a little bit more room down there. 226 00:11:16,720 --> 00:11:19,710 And I'm going to go to build and I'm going to select run. 227 00:11:21,510 --> 00:11:24,010 Do I want to build and execute or just execute? 228 00:11:24,010 --> 00:11:26,010 I've already built it so I'm just going to execute it. 229 00:11:26,910 --> 00:11:30,410 And we get a terminal window popup and it says Hello World, 230 00:11:30,410 --> 00:11:31,660 hit any key to continue. 231 00:11:31,660 --> 00:11:33,260 The Hello world is our program. 232 00:11:33,260 --> 00:11:36,140 The hit any key to continue is what CodeLite puts in there 233 00:11:36,140 --> 00:11:39,640 because otherwise it would just display that and close up the window real fast. 234 00:11:39,640 --> 00:11:43,540 So, we press any key to continue, it closes the window and we are done. 235 00:11:44,340 --> 00:11:48,140 So, that's it, simple as that, that's the way we organize this. 236 00:11:48,140 --> 00:11:49,830 In a couple of videos from now, 237 00:11:49,830 --> 00:11:53,030 I'm going to have a video that shows you how to create a project template, 238 00:11:53,030 --> 00:11:56,530 so that we don't have to do the std equals C++ 17 part 239 00:11:56,530 --> 00:11:58,130 which saves us a little bit of time. 240 00:11:58,820 --> 00:11:59,320 Great. 241 00:11:59,320 --> 00:12:01,920 So, let's create another project. 242 00:12:01,920 --> 00:12:05,120 And the second project is going to be basically the same source code, 243 00:12:05,120 --> 00:12:07,020 again close this down here. 244 00:12:07,020 --> 00:12:09,270 So, I'm just going to copy this source code, 245 00:12:09,270 --> 00:12:11,870 I'm going to press CTRL C to copy 246 00:12:11,870 --> 00:12:16,560 and I'm going to go to my workspace and I'm going to select right click, 247 00:12:17,860 --> 00:12:19,460 new project. 248 00:12:20,760 --> 00:12:23,310 I get the same new project wizard 249 00:12:23,310 --> 00:12:26,310 and I'm going to create project Two in this case. 250 00:12:26,810 --> 00:12:30,910 Again, no spaces, no special characters, no international characters. 251 00:12:30,910 --> 00:12:34,510 Make sure that create the project in its own folder is selected, 252 00:12:34,510 --> 00:12:38,770 these settings should carry over from the last time we did this, 253 00:12:38,770 --> 00:12:42,270 so we've got console simple executable G++, GCC, 254 00:12:42,270 --> 00:12:45,870 the GNU gdb debugger and CodeLite make file generator. 255 00:12:45,870 --> 00:12:46,870 We'll click OK. 256 00:12:47,370 --> 00:12:50,060 And now, over here, you can see we have project Two 257 00:12:50,060 --> 00:12:52,860 and it's got a source folder and it's got a main CPP. 258 00:12:52,860 --> 00:12:56,410 Let me expand these, so you can see that they are two distinct projects. 259 00:12:56,770 --> 00:12:58,270 Now if you look up here, 260 00:12:58,270 --> 00:13:00,770 you know that this is the source code for project One. 261 00:13:00,770 --> 00:13:02,770 You can see that right up here in the tab. 262 00:13:02,770 --> 00:13:06,370 And if I double click on this main CPP, it will open up next to it 263 00:13:06,370 --> 00:13:09,370 and that's project Two, so this is project One's main, 264 00:13:09,370 --> 00:13:10,970 this is project Two's main. 265 00:13:11,370 --> 00:13:14,670 So, I'm just going to grab all that and paste 266 00:13:14,670 --> 00:13:17,670 the other one that I copied into it and I'm going to say Hello World 267 00:13:17,670 --> 00:13:20,270 from project Two. 268 00:13:21,870 --> 00:13:25,470 Notice the black dot up here, so I'm going to hit CTRL S to save. 269 00:13:25,470 --> 00:13:27,270 Now, I know that I've saved this. 270 00:13:27,270 --> 00:13:29,660 Now, we're going to do the same thing, we're going to set up project Two, 271 00:13:29,660 --> 00:13:32,560 so I'm going to click on Project Two, click on the wrench 272 00:13:33,860 --> 00:13:36,860 and right here, you can always see up here it says project two settings 273 00:13:37,550 --> 00:13:40,350 and this really stretched out that time. 274 00:13:40,350 --> 00:13:42,230 There we go, let's try that. 275 00:13:42,230 --> 00:13:46,030 So again, general, we're going to come right here to working directory. 276 00:13:46,030 --> 00:13:48,580 I'm going to delete that and I'm going to type dollar 277 00:13:48,580 --> 00:13:51,180 project path 278 00:13:51,180 --> 00:13:54,780 inside parentheses with the two p's uppercase. 279 00:13:55,980 --> 00:13:58,670 That's it. Then I'm going to go to my compiler, 280 00:13:58,670 --> 00:14:01,470 go to my C++ compiler options, 281 00:14:02,460 --> 00:14:05,060 click that button with the three dots, 282 00:14:05,060 --> 00:14:10,060 select enable C++ 17 features stood equals C++ 17. 283 00:14:10,750 --> 00:14:14,650 Click OK, apply, click OK. 284 00:14:14,650 --> 00:14:16,150 Now, we're ready to build 285 00:14:16,150 --> 00:14:17,360 but we have to wait a second, 286 00:14:17,360 --> 00:14:21,760 we can't just build now, because if we build, the active project will be built. 287 00:14:21,760 --> 00:14:23,960 And that's project one, you can see here. 288 00:14:23,960 --> 00:14:27,320 I don't want to build Project One, I want to build Project Two. 289 00:14:27,320 --> 00:14:28,220 So, what I can do is? 290 00:14:28,220 --> 00:14:31,220 I can right click on Project Two and make it active 291 00:14:31,620 --> 00:14:33,310 or I could just double click on it. 292 00:14:33,310 --> 00:14:37,210 When I double click on it, you can see that it's now the active project, 293 00:14:37,210 --> 00:14:39,710 it's bold and italicized. 294 00:14:40,110 --> 00:14:44,710 So I can come back up to build, I can select rebuild Project, 295 00:14:46,400 --> 00:14:49,300 we have our build output down here and you can see that 296 00:14:49,300 --> 00:14:52,000 Project Two has been built right here. 297 00:14:52,000 --> 00:14:56,000 We've got all the options we want, so this is a good thing, I'll close this up. 298 00:14:56,000 --> 00:14:59,300 And now, we're ready to run, so I'm going to go build and run. 299 00:14:59,300 --> 00:15:01,500 I'm just going to execute and now, 300 00:15:01,500 --> 00:15:05,400 we should say Hello World from Project Two, which is exactly what we see. 301 00:15:06,000 --> 00:15:09,990 We can press any key, I'm just going to press Enter to close this down. 302 00:15:09,990 --> 00:15:12,990 So that's it, we've got our build environment working. 303 00:15:12,990 --> 00:15:14,990 Now, we can start writing code. 304 00:15:14,990 --> 00:15:18,590 The other thing that I'd like you to do is go up to Settings 305 00:15:19,490 --> 00:15:20,690 and Preferences 306 00:15:21,680 --> 00:15:25,040 and come all the way over here on the right to miscellaneous and just click that. 307 00:15:25,040 --> 00:15:28,840 And in startup right here, there is a check for new version on 308 00:15:28,840 --> 00:15:30,840 startup and I want you to uncheck that. 309 00:15:31,640 --> 00:15:35,000 Otherwise CodeLite is going to ask you to upgrade to a new version every time, 310 00:15:35,000 --> 00:15:36,690 there's a new version or a point release. 311 00:15:36,690 --> 00:15:40,590 My advice is to resist the urge to update. 312 00:15:40,590 --> 00:15:43,390 If you've got a working environment that's working 313 00:15:43,390 --> 00:15:46,080 and you're able to use it to develop programs, 314 00:15:46,080 --> 00:15:47,080 don't mess around with it. 315 00:15:47,080 --> 00:15:50,380 Just use the same development environment throughout the course. 316 00:15:50,380 --> 00:15:53,380 Sometimes we think that the upgrades are better. 317 00:15:53,380 --> 00:15:56,980 A lot of times upgrades are bleeding edge and they're full of bugs and 318 00:15:56,980 --> 00:15:58,670 they're not really worth the trouble. 319 00:15:58,920 --> 00:16:00,220 So once we've got 320 00:16:00,220 --> 00:16:04,120 a working development environment, leave it alone, it works great. 321 00:16:04,120 --> 00:16:06,420 I'm going to apply, click OK. 322 00:16:07,020 --> 00:16:10,320 And that's it, we're ready to go, our build environment is set up. 323 00:16:11,120 --> 00:16:15,720 One more thing, when I build, it's possible that we have errors, right? 324 00:16:15,720 --> 00:16:18,720 Of course, we can have typos, we can have syntax errors. 325 00:16:18,720 --> 00:16:23,080 So for example, suppose I forgot that semicolon right there, 326 00:16:23,080 --> 00:16:26,080 I can come up to, first I'm going to save 327 00:16:26,880 --> 00:16:30,240 and there's a little red arrow there that's telling me there's a problem 328 00:16:30,240 --> 00:16:32,740 there's expecting a semicolon after namespace. 329 00:16:32,740 --> 00:16:34,240 That's not the compiler, 330 00:16:34,240 --> 00:16:35,930 that's the CodeLite IntelliSense, 331 00:16:35,930 --> 00:16:39,830 if you will, which is kind of going through our code and looking at it and trying to help us out. 332 00:16:39,830 --> 00:16:43,130 But if we build, you can see that we have a syntax error. 333 00:16:43,130 --> 00:16:45,730 It says expecting a semicolon before the int 334 00:16:45,730 --> 00:16:50,090 and we have an error and our program did not build correctly. 335 00:16:50,090 --> 00:16:52,780 So we don't want to run this program until we fix the error. 336 00:16:52,780 --> 00:16:55,280 There are a lot of errors that we can get, and we'll do a whole 337 00:16:55,280 --> 00:16:58,080 video on just the kinds of errors that you'll see common errors. 338 00:16:58,080 --> 00:16:59,680 This is one that's really common 339 00:16:59,680 --> 00:17:01,980 is forgetting the semicolon at the end. 340 00:17:01,980 --> 00:17:06,339 A lot of student spell io stream wrong and they put io steam, 341 00:17:06,339 --> 00:17:07,540 so that's a problem. 342 00:17:07,540 --> 00:17:09,339 If we misspell Main, 343 00:17:09,339 --> 00:17:12,700 you can imagine if we put spaces between these two angle brackets, 344 00:17:12,700 --> 00:17:15,300 if we forget one of these parentheses, 345 00:17:15,300 --> 00:17:17,800 so there's a lot of places the syntax has to be just right. 346 00:17:17,800 --> 00:17:20,599 But again, we'll talk about all of this in the course. 347 00:17:20,599 --> 00:17:22,589 At this point, you're good to go. 348 00:17:22,589 --> 00:17:26,849 If you have any questions or any issues, please post them in the forum. 349 00:17:26,849 --> 00:17:30,540 Look on the forums, because just about every question has already been asked and answered. 350 00:17:30,540 --> 00:17:34,540 But if you have a question that's not out there, please post it and I'll be happy to help you. 351 00:17:34,540 --> 00:17:37,140 The next video, you should go to in this section is 352 00:17:37,140 --> 00:17:40,500 the video that shows how to create a default project template, 353 00:17:40,500 --> 00:17:41,500 so I'll see you there.