 Welcome! Today we're going to continue our series on C programming but what we're going to look at doing is we're going to look at taking an application we wrote in C and compiling it for Windows but on a Linux machine. So if you're developing on Linux you can compile it for Windows. Of course you'd want to test it on a Windows machine. But let's go ahead and look at that one. We don't have to change our code at all for most of our projects. So we're just going to compile our Hello World, you know, our first little application. Just this here, okay? But we need a compiler that will cross compile for us. So I'm on a WN based machine. I'm going to use aptitude as my package manager but whatever distro you're on use your package manager and what we're going to do is we're going to search for MingW. It's going to give us a list of packages. The one we're going to install is this MingW-W64. Might be named slightly different on yours but once you install that it's going to install you see all these ones with eyes it installs that so that's a little meta package. It's going to install these and also installed these ones up here. So these. Bin utility, Ming32. So you're just looking for something that says MingW again it might be called something different on other systems depending on what distribution you're using. But you should be able to figure out which one is which and once it's installed I've already installed it so use your package manager you know apt-inst-oops apt or aptitude install MingW-W64. Again that's on a WN based system. I already have it installed but you go through the install process you can also use a GUI package manager if you want. Once that's installed now I'm going to type in I6 and hit tab and you can see I have I686-W64 Ming32- and if I hit tab a few more times it will give me autocomplete here. And when we're looking for is dash GCC because you can see it's got a bunch of different compilers in here. We're going to be using the dash GCC. This may change in time when I first started doing this it was I586 I think and now it's I686 so in the future it might change but you'll get the general idea once you install it it's it's pretty self-explanatory which one is which. And just like using regular GCC I just give it the name of our input file dash O for output file I'm going to put it in our bin folder and I'll just call it hello windows actually let's do it hello dash windows dash exe. No it didn't return any errors so we should be good and I can use my file command to look at the file so we'll do that and it will tell us that this is a executable for MS Windows and it's a console application we'll talk more about that in a future video as we work on hiding our windows. So yeah let's let's I'm gonna save this and go to a Windows machine and test it out. So here I am I've downloaded the executable that we compiled on Linux for Windows onto an actual Windows machine and now if I double-click it it's gonna ask me if I are you sure you want to run it I'm gonna uncheck that so it doesn't ask me anymore and I'm gonna click run and you'll see the shell console open up for a second and flash. Obviously if we wanted to keep that open we'd have to tell our code to pause after running our hello function but here we are in the shell and if I run the executable you can see it says hello world. So there we go we compiled executable for Windows on Linux and of course you can get this code and all the other codes in this series by going to my GitLab page that's gitlab.com forward slash metalx1000 capital my capital bin and in there you can go to a folder that's marked C under tutorials list all the files for this series and of course under my this particular project this is just a bunch of random scripts and codes and stuff I've written over the years some of it I haven't updated a while but you might want to look through some other stuff on there and I hope that you also visit my website filmsbychrist.com that's Chris the K there's a link in the description to that as well you can search through my videos you can also go to the software section where there's a link to my GitLab page online scripts I've created and notes are all my paste bins in a searchable format so you can look through that as well I do hope that you have a great day think about supporting me on Patreon or through PayPal you can do that on my website or there's links in the description this video and I hope that you have a great day