Wie man native C++-Executable für Teltonika RUTX10 / RUTX11 cross-kompiliert
English
Deutsch
Laden Sie zuerst das vorkonfigurierte OpenWRT-Buildroot von Teltonika herunter.
Entpacken Sie es:
extract_rutos_buildroot.sh
tar xzvf RUTX_R_GPL_00.07.04.1.tar.gzcd_rutos_dir.sh
cd rutos-ipq40xx-rutx-gpl/und bauen Sie nun mit
build_rutos.sh
./scripts/feeds update -a
make -iDies wird nicht nur die Toolchain, sondern auch alle Pakete usw. bauen, daher wird es eine Weile dauern.
Erstellen Sie nun main.cpp, z.B.:
main.cpp
#include <iostream>
int main(int argc, char** argv) {
std::cout << "Hello World!" <<std::endl;
}Das Build-Skript build.sh sieht so aus:
build.sh
#!/bin/sh
export STAGING_DIR=~/rutos-ipq40xx-rutx-gpl/staging_dir
export TOOLCHAIN=${STAGING_DIR}/toolchain-arm_cortex-a7+neon-vfpv4_gcc-8.4.0_musl_eabi
export CC=${TOOLCHAIN}/bin/arm-openwrt-linux-musulgnueabi-gcc
export CPP=${TOOLCHAIN}/bin/arm-openwrt-linux-musulgnueabi-g++
# Build !
${CPP} -o main main.cppDies wird main erzeugen, eine ausführbare Datei, die Sie auf Ihr RUTX10 kopieren und ausführen können.
Check out similar posts by category:
OpenWRT
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow