On Mon, 08 Jul 2019 14:07:15 -0400, Dennis Lee Bieber
<
wlf...@ix.netcom.com> declaimed the following:
And... success...
-=-=-=-
wulfraed@stretch:~$ sudo apt install crossbuild-essential-armhf
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
binutils-arm-linux-gnueabihf cpp-6-arm-linux-gnueabihf
cpp-arm-linux-gnueabihf cross-config dpkg-cross g++-6-arm-linux-gnueabihf
<SNIP>
libtool flex bison gdb-arm-linux-gnueabihf gcc-doc
The following packages will be REMOVED:
g++-multilib gcc-multilib
The following NEW packages will be installed:
binutils-arm-linux-gnueabihf cpp-6-arm-linux-gnueabihf
<SNIP>
libubsan0-armhf-cross libxml-simple-perl linux-libc-dev-armhf-cross
0 upgraded, 27 newly installed, 2 to remove and 26 not upgraded.
Need to get 29.1 MB/29.2 MB of archives.
After this operation, 101 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Media change: please insert the disc labeled
'Debian GNU/Linux 9.1.0 _Stretch_ - Official amd64 DVD Binary-1
20170722-11:31'
<SNIP>
arm-linux-gnueabihf-gcc-ranlib
wulfraed@stretch:~$ arm-linux-gnueabihf-g++ -v
Using built-in specs.
COLLECT_GCC=arm-linux-gnueabihf-g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc-cross/arm-linux-gnueabihf/6/lto-wrapper
Target: arm-linux-gnueabihf
<SNIP>
Thread model: posix
gcc version 6.3.0 20170516 (Debian 6.3.0-18)
wulfraed@stretch:~$ vim testcross.cpp
wulfraed@stretch:~$ cat testcross.cpp
#include <iostream>
using namespace std;
int main()
{
cout << "Testing cross compilation for armhf" << endl;
return 0;
}
wulfraed@stretch:~$ arm-linux-gnueabihf-g++ testcross.cpp -o testcross
wulfraed@stretch:~$ ls -l
total 360
<SNIP>
-rwxr-xr-x 1 wulfraed wulfraed 9184 Jul 8 14:51 testcross
-rw-r--r-- 1 wulfraed wulfraed 125 Jul 8 14:50 testcross.cpp
drwxr-xr-x 2 wulfraed wulfraed 4096 Sep 10 2017 Videos
wulfraed@stretch:~$ ./testcross
bash: ./testcross: cannot execute binary file: Exec format error
wulfraed@stretch:~$ sftp debian@beaglebone
debian@beaglebone's password:
Connected to beaglebone.
sftp> put testcross
Uploading testcross to /home/debian/testcross
testcross 100% 9184 1.1MB/s 00:00
sftp> quit
wulfraed@stretch:~$
-=-=-=-
debian@beaglebone:~$ ls -l
total 136
-rwxr-xr-x 1 debian debian 94852 Jul 8 12:14 BBB_test.out
drwxr-xr-x 2 debian debian 4096 Jun 17 2018 bin
-rwxr-xr-x 1 debian debian 8340 Jul 8 11:47 demo
-rw-r--r-- 1 debian debian 94 Jul 8 11:47 demo.c
-rw-r--r-- 1 debian debian 325 Jan 30 17:03 pwm.py
-rw-r--r-- 1 debian debian 620 Jan 30 17:20 sqwave.py
-rwxr-xr-x 1 debian debian 9184 Jul 8 14:55 testcross
debian@beaglebone:~$ ./testcross
Testing cross compilation for armhf
debian@beaglebone:~$
-=-=-=-
So... for the OP... You are now reliant upon Ubuntu having duplicated
the Debian cross-compilation build tools so you can install them easily.
(What is this love affair with Ubuntu -- especially when the target boards
[Beagle and R-Pi's both] are often based upon Debian; just seems like
working with a Debian image on a desktop minimizes quirks when moving from
one system to another).