{{{#!html
Native Compiling is when you build a program on the target device itself. This is different from using the SDK to compile on a host system and copy the binaries onto the target device. The goal of this page is to instruct how to install and use some of these developer tools on the target device.
To start, it is required to modify the base Yocto build on the desktop machine with the developer tools included in the build.
IMAGE_FEATURES_append = " tools-sdk dev-pkgs " IMAGE_INSTALL_append = " kernel-dev git subversion "
To compile a simple hello world C application on the Gateworks SBC, please see the following example.
This will only work once the Installation of the Developer Tools above has been performed.
cat <<EOF > hello.c
#include <stdio.h>
int main(void) {
puts("Hello, world!");
return 0;
}
EOF
gcc hello.c -o hello_c ./hello_c
To compile a simple hello world C++ application, please see the following example.
cat <<EOF > hello.cpp
#include <iostream>
int main() {
std::cout << "Hello, world!" << std::endl;
return 0;
}
EOF
g++ hello.cpp -o hello_cpp ./hello_cpp
This example will clone the gst-gateworks-apps project and compile it. Note that compiling this program requires that gstreamer-1.0 and gstreamer1.0-rtsp-server are installed which are included by default in the gateworks-image-multimedia image.
git clone https://github.com/Gateworks/gst-gateworks-apps.git
cd gst-gateworks-apps
make
Binaries are stored in the bin/ directory.
}}}