 Hello and welcome! This video is part of a series on C programming. What we're going to look at today is compiling applications for other architectures. In this particular case I am going to compile on my desktop for an ARM machine. An ARM machine, ARM is one of the most common processor types, processor architectures, architectures for smaller applications, smaller devices such as phones, routers, modems, or if you have a Raspberry Pi, it's going to be compiled for ARM. And a lot of those systems I listed are probably running Linux, but because of the architecture, because of the processor, it needs to be compiled for that processor. So you write the applications the same, but then you compile it for that architecture. I am running on my desktop here, which is Debian based system. I'm going to install some stuff like this. I'm going to use aptitude or apt as my package manager, but use whatever packet manager you have for your distro. And I'm going to then go to a Raspberry Pi and log into Raspberry Pi to test out the application. So what we're going to do is I'm going to use aptitude as my package manager. And I am going to then say aptitude search. And what I'm going to search for is GNU E-A-B-I. It's going to give you a bunch of lists, a list of bunch of different stuff here. Most of which is what we're kind of things we're looking for, compiling for different architectures. But what we're looking for is going to be the GCC ARM Linux base. Now, the current version I have here is 10. You can also see that my package, my repositories also have eight and nine. So just install the most current one. In fact, if you were to install this without the number, it will install whatever the default one is for your system. I went ahead and went and installed GCC-10. It's just the highest number. So I went with it. It doesn't really matter. But we're doing GCC since we're doing C compiling here. So go ahead and use your package manager to install that apt, aptitude, aptget, whatever you use. Once it is installed, you should be able to type an ARM dash and hit tab and it will auto complete to this. And I'm going to say GCC-10 in my case. Again, the number might change for years. But then at this point, we compile just like we would compile with a regular GCC compiler. So I'm going to say our Hello World application. And I'm going to say the output. I'm going to put it in bin. And I'm going to say ARM Hello. And no errors when I went to compile that. Let me just shrink this down so it's on one line for you. So now I can say file. I can file out, again, all my files in my bin directory. And you can see all the files we've compiled. Again, all this, all the code and all these compiles are up on my GitLab. There should be a link in the description of this video. You can go and download it from there. But as you can see, all our applications compiled. We have the 64-bit for x86 architectures. Down here we have our Windows executables, both console and GUI that we did in previous videos. But then you look right here at our ARM Hello. And you can see right here, it's a 32-bit, in our particular case, ARM architecture. And it's dynamically linked, which we'll talk about more in the next video. Now, again, this is compiled for Linux. I'm going to go to a, I'm going to log into a Raspberry Pi, which is running Debian Linux. I'm running Debian Linux. So I could try running bin ARM Hello, but it's going to say that it can't find this linked file here, blah, blah, blah. It's not set up for this system. Even though they're both the same operating system, it's different architecture. Again, we didn't have to change our code. We just compiled it, which is a great thing about open source applications. For the most part, if they're written properly and they're not too specific to an operating system, obviously, if you're writing something specific to an operating system, like you're writing something to interact with Internet Explorer or something like that, obviously, it's specific to that operating system. But if it's not operating system specific, what you're working on, you can just compile, cross compile for stuff if you have the code. It doesn't matter whether the careers of the code compiled for whatever architecture you should be able to compile for it. But obviously, it's not going to run this. So let me go ahead and right here, I am logged into my Raspberry Pi, and it is, let me go uname-a. So you can see here, we're writing Linux, and you can see that it's an ARM version 6, a new Linux kernel. And what we're going to do here is we are going to, I've already copied the file over. We can list it out. There it is, file, I can say ARM. You can see that it is showing that it is an ARM, you know, dynamically linked. Again, we'll talk about that more in the next video. But now I should just be able to say, forward slash dot slash, the name of the file, and it runs. So again, we'll go back here. Once you have it installed, you do run just like regular GCC, you say ARM, Linux, GNU, E-A-B-I dash GCC, whatever version of GCC it is, and name of our application dash O for output, and you have compiled it for another architecture. And that is it. Now there are certain systems where you might get an error. We'll talk about that in our next video, where we're going to do statically linked instead of dynamically linked. So stay tuned for that. Thanks for watching. Again, check out the links in the description to my website, filmsbychrist.com, that's Chris the K. There should also be a link to my GitLab page, which has all this code, and everything already compiled in our bin folder. So check that out. Once you go to that link, it's going to be under the C folder tutorials, and then you'll see all these files there. Thanks for watching, and I hope you have a great day.