I found the latest rpb have not a gcc compiler. So how can i get a compiler for c/c++?
RPB(Yocto) is just a reference image, you tipically need to cutomize your recipes to generate a customized image. For this, you can modify the RPB distro layer (/layers/meta-rpb), or add a new one… One solution is to add packagegroup-core-buildessential to the rpb image packegegroups list (meta-rpb/recipes-samples/packagegroups/packagegroup-rpb.bb) and rebuild images.
You can also build the missing package(s) only and push/install the generated RPM package(s) to the board:
$ bitbake packagegroup-core-buildessential
cf https://github.com/Linaro/documentation/blob/master/Reference-Platform/CECommon/OE.md
Is there any easier way to do it? For example I copy a binary file to my board? If yes, which I can choose ?
The above is the easy way!
It is certainly possible to copy binaries from another distribution such as Debian but by the time you have found them and manually chased up all the header file and shared library dependencies you would probably have been better off rebuilding OE.
Once I build a package, like the packagegroup-core-build-essential, how do I install that onto the board.
The package should be available as a RPM package in the build directory (e.g. in build-rpb/tmp-rpb-glibc/deploy/rpm/aarch64). You can push the package on the board (via network, usb mass storage…) and install it via the rpm tool (rpm -i). Note that when you build a package, dependencies are also built, so you may end up installing several packages to install your targeted package.
I am trying to compile and run C on my HiKey board. As mention above I have install all the packages for build essential package. The issue I am having now is that I can’t compile and run a simple “hello world” program in C on the board. How can I get the basic gcc compiler to work like it would on my Ubuntu computer?