Let's start by creating a simple C++ program, which we want to compile for our target platform:
- Create a file named hello.cpp in the ~/test directory.
- Use your favorite text editor to add the following code snippet to it:
#include <iostream>int main() { std::cout << "Hello, world!" << std::endl; return 0;}
- Now that we have the code for the Hello, world! program, we need to compile it.
- Switch to the Ubuntu (our build system) console.
- Get the up-to-date list of packages available for the installation by running the following command:
# apt update -y
- It will take some time to fetch the package descriptions from the Ubuntu servers. Run the following command to install the cross-compilation tools:
# apt install -y crossbuild-essential-armel ...