1 00:00:05,200 --> 00:00:06,700 Hello everyone. Frank here. 2 00:00:06,700 --> 00:00:11,060 This is the video that's going to be showing you how to install the MinGW 3 00:00:11,060 --> 00:00:12,860 64 compiler. 4 00:00:12,860 --> 00:00:16,160 I know there's been a lot of trouble with servers and VPNs 5 00:00:16,160 --> 00:00:18,160 and Firewalls and all kinds of stuff, 6 00:00:18,160 --> 00:00:20,660 so hopefully this will, will help with that. 7 00:00:21,160 --> 00:00:22,260 So let's get started. 8 00:00:22,260 --> 00:00:26,660 Open up your favourite browser and head over to winlibs.com. 9 00:00:26,860 --> 00:00:31,150 This is, is a library where they've got standalone builds of GCCN, 10 00:00:31,150 --> 00:00:34,050 MinGW 64 for Windows. 11 00:00:34,050 --> 00:00:37,850 And once we're here, we want to click the download link right here. 12 00:00:38,650 --> 00:00:43,550 And what we're at now is, we're at a page where we can download different versions of the compiler. 13 00:00:43,550 --> 00:00:48,240 We can download 32 bit or 64 bit versions of the compiler. 14 00:00:48,240 --> 00:00:51,790 This depends, obviously on the architecture that you've got on your machine. 15 00:00:51,790 --> 00:00:55,590 So it's really important that you, make sure you got the right one. 16 00:00:55,590 --> 00:00:58,590 If you're not sure whether you've got a 32 bit operating system 17 00:00:58,590 --> 00:01:02,190 or a 64 bit operating system, it's really easy to tell. 18 00:01:02,190 --> 00:01:07,790 Just press the Windows key and type Control Panel in the search 19 00:01:09,590 --> 00:01:11,890 and head over to the Control Panel 20 00:01:11,890 --> 00:01:13,890 and then click on System and Security. 21 00:01:14,880 --> 00:01:19,080 And then under System view the amount of Ram and processor speed 22 00:01:19,080 --> 00:01:21,280 and that will display this window. 23 00:01:21,280 --> 00:01:23,880 And you can see right here where it says System type. 24 00:01:24,480 --> 00:01:27,180 Mine says 64 bit operating system, 25 00:01:27,180 --> 00:01:27,980 x 64. 26 00:01:27,980 --> 00:01:31,980 Yours might say 32 bit operating system, x 86. 27 00:01:31,980 --> 00:01:33,780 So be sure you've got the right one. 28 00:01:33,780 --> 00:01:35,980 I know I've got a 64 bit system, 29 00:01:35,980 --> 00:01:39,180 so I'm going to download the 64 bit version of the compiler, 30 00:01:39,180 --> 00:01:41,980 which is this one right here, Windows 64. 31 00:01:41,980 --> 00:01:43,980 And I'm going to download this zip archive. 32 00:01:43,980 --> 00:01:47,480 Don't download these over here on the right, just this one right here. 33 00:01:47,480 --> 00:01:50,280 Or if you're on a 32 bit system, this one right here. 34 00:01:50,280 --> 00:01:54,970 Now as far as whether it's version 12.2 or 3 or 1 or whatever is out there, 35 00:01:54,970 --> 00:01:57,570 just download the latest one. Okay? 36 00:01:57,570 --> 00:01:59,870 As of this recording, this is the latest one. 37 00:01:59,870 --> 00:02:02,470 So I'm going to click on that and download the zip archive. 38 00:02:02,470 --> 00:02:06,070 Now I've already done that to save two times and I put it on my desktop 39 00:02:06,670 --> 00:02:07,670 and here it is. 40 00:02:07,670 --> 00:02:08,770 Now what we want to do is 41 00:02:08,770 --> 00:02:11,370 We want to extract that zip archive. 42 00:02:11,370 --> 00:02:13,370 There's no installer built-in, 43 00:02:13,370 --> 00:02:17,570 you can't just double click and have this compiler install. 44 00:02:17,570 --> 00:02:20,870 What we want to do is Just unzip this file, 45 00:02:20,870 --> 00:02:23,570 store it in a place and then update the Windows path 46 00:02:23,570 --> 00:02:26,370 and that's all we need to know when we're done. It's a pretty easy thing to do. 47 00:02:26,370 --> 00:02:31,370 So, I want to right click on here and I want to select Extract All 48 00:02:32,670 --> 00:02:35,970 and get rid of all this extra stuff that's in here. 49 00:02:35,970 --> 00:02:39,970 All we want to really put in there is C colon back slash. 50 00:02:40,750 --> 00:02:44,350 C colon back slash. That's it. That's all we want to do here. 51 00:02:44,350 --> 00:02:45,350 What's going to happen is 52 00:02:45,350 --> 00:02:50,610 This is going to be extracted to a MinGW 64 folder right here. 53 00:02:50,610 --> 00:02:52,510 Don't put this in program files. 54 00:02:52,510 --> 00:02:53,710 Don't put it anywhere else. 55 00:02:53,710 --> 00:02:55,310 Just put it right off your C drive. 56 00:02:55,610 --> 00:02:58,710 So, you can select, show extracted files when complete, 57 00:02:58,710 --> 00:03:00,710 I'm not, I'm just going to click Extract. 58 00:03:01,710 --> 00:03:04,010 And this process takes a little while. 59 00:03:04,010 --> 00:03:07,610 There's about 7900 items that it has to extract. 60 00:03:07,830 --> 00:03:09,830 So, it might take a couple of minutes. 61 00:03:09,830 --> 00:03:13,330 I'll speed up the video here just to save a little bit of time. 62 00:03:29,020 --> 00:03:31,320 All right, so the process is almost complete. 63 00:03:31,320 --> 00:03:35,820 It probably took about four minutes on my computer and we're done. 64 00:03:35,820 --> 00:03:38,820 We've unzipped that archive. 65 00:03:38,820 --> 00:03:40,320 Now, what we want to do is 66 00:03:40,320 --> 00:03:45,320 Open up file explorer and go over to your C drive. 67 00:03:46,220 --> 00:03:49,820 And you will see a folder called MinGW 64. 68 00:03:49,820 --> 00:03:52,420 You can see it right here, that's what was just created. 69 00:03:52,420 --> 00:03:54,420 And if I double click on there, 70 00:03:54,420 --> 00:03:56,920 you'll see the bin folder, the include folder. 71 00:03:56,920 --> 00:04:01,520 These are all the folders that the MinGW C++ compiler needs. 72 00:04:01,520 --> 00:04:03,920 This is the most important one, the bin folder. 73 00:04:03,920 --> 00:04:05,720 That's where all the binaries are. 74 00:04:05,720 --> 00:04:09,920 This is where the actual compiler and the linker and the loader and all this good stuff is at. 75 00:04:09,920 --> 00:04:14,220 So, this is the path that we want to add to Windows, 76 00:04:14,220 --> 00:04:16,720 so that Windows can find this compiler, 77 00:04:16,720 --> 00:04:17,709 whenever we need it. 78 00:04:17,709 --> 00:04:21,310 So the easiest way to do that is, just click on this little folder right here. 79 00:04:22,000 --> 00:04:27,000 And there's your path, you can see it c:/mingw64/bin. 80 00:04:27,000 --> 00:04:29,500 I just want to right click on that and copy. 81 00:04:30,800 --> 00:04:34,400 And at this point, I want to close down explorer because I'm done with it. 82 00:04:35,100 --> 00:04:35,980 Now, what we want to do is 83 00:04:35,980 --> 00:04:38,980 We want to set our Windows environment variable. 84 00:04:38,980 --> 00:04:40,980 And again, this is really easy to do. 85 00:04:41,180 --> 00:04:43,730 So I'm just going to come down to my taskbar 86 00:04:43,730 --> 00:04:46,730 and just click the search and type environment. 87 00:04:47,130 --> 00:04:51,630 And you can see right here it says, Edit the system, let me try that again. 88 00:04:52,230 --> 00:04:53,330 There we go. 89 00:04:53,330 --> 00:04:56,330 Edit the system environment variable, so I'm going to select that. 90 00:04:57,020 --> 00:04:59,820 And I get this little window that pops up. 91 00:04:59,820 --> 00:05:01,620 Let me move this out of the way. 92 00:05:01,620 --> 00:05:02,520 There we go. 93 00:05:02,520 --> 00:05:06,920 And you'll see this button right here, environment variables. That's what we want to select. 94 00:05:08,820 --> 00:05:12,510 And I want to come down to my system variables down here 95 00:05:12,510 --> 00:05:16,200 and look for the variable called Path, you can see it right there. 96 00:05:16,200 --> 00:05:19,800 And this is the one that we want to edit. So I'm going to select the edit button. 97 00:05:21,400 --> 00:05:23,000 And we've got a bunch of stuff in here. 98 00:05:23,000 --> 00:05:25,600 And it's really important that you don't mess with anything that's in here 99 00:05:25,600 --> 00:05:27,200 because that could really cause issues. 100 00:05:27,200 --> 00:05:30,100 All we want to do is add a new path variable. 101 00:05:30,100 --> 00:05:31,600 So I'm going to select new. 102 00:05:32,200 --> 00:05:36,200 And right here, I'm just going to right click and paste what I copied earlier. 103 00:05:36,200 --> 00:05:39,890 And now you can see that I've added the mingw64/bin 104 00:05:39,890 --> 00:05:42,390 path to my existing path. 105 00:05:42,390 --> 00:05:43,190 Perfect. 106 00:05:43,190 --> 00:05:44,490 Click OK. 107 00:05:44,490 --> 00:05:46,090 Click OK again. 108 00:05:46,090 --> 00:05:48,090 And click OK once more. 109 00:05:48,090 --> 00:05:51,890 That's it, our compiler is installed, we can test it really quickly. 110 00:05:51,890 --> 00:05:54,250 Again, I'm going to press the Windows key 111 00:05:54,250 --> 00:05:56,850 and I'm just going to type command CMD 112 00:05:57,250 --> 00:05:59,390 and open up a command prompt window 113 00:06:02,690 --> 00:06:04,380 and you can see it right here. 114 00:06:04,380 --> 00:06:09,980 And all we have to do here is type g++ -- version 115 00:06:10,580 --> 00:06:11,580 and press Enter. 116 00:06:11,580 --> 00:06:16,580 And if our compiler is installed correctly, we should get information about the compiler. 117 00:06:16,580 --> 00:06:19,880 And there's the information, you can see it 12.2, 118 00:06:19,880 --> 00:06:22,080 0 was the version, we installed 119 00:06:22,080 --> 00:06:24,680 and we're pretty much done installing the compiler. 120 00:06:25,480 --> 00:06:29,140 If you type just g++, it'll say something about 121 00:06:29,140 --> 00:06:32,640 fatal error, no input files, that's okay, that's a good install. 122 00:06:32,640 --> 00:06:35,330 It's just telling you, hey, I don't know what to compile. 123 00:06:35,330 --> 00:06:36,690 You haven't provided anything. 124 00:06:36,690 --> 00:06:39,190 So if you type g++ and you get this 125 00:06:39,190 --> 00:06:42,190 error here, it's okay, it's a normal error. 126 00:06:42,190 --> 00:06:45,880 But g++ -- version is what we really want to type 127 00:06:45,880 --> 00:06:50,170 to be sure that we've got our chamber, we installed. Okay? 128 00:06:50,170 --> 00:06:55,170 So that's it, that takes care of installing the MinGW 64 compiler. 129 00:06:55,170 --> 00:06:57,530 In the next video, we'll install Code Lite 130 00:06:57,530 --> 00:07:01,530 and then we'll get Code Lite to talk to this compiler so that Code Lite 131 00:07:01,530 --> 00:07:03,830 can use the compiler to compile our source code. 132 00:07:03,830 --> 00:07:05,830 I'll see you in the next video.