Executing of C++ arm code in Eclipse fails

Hello,

In his book “Exploring BeagleBone”, Derek Molloy provides example of executing of the source code that built on host machine using cross toolchain. For that QEMU emulator must be installed on host machine.

In terminal it works fine when a source is built with -static option:

pavel@ALABAMA:~/bbb_cross_toolchain_code$ arm-linux-gnueabihf-g++ -static testcross.cpp -o testcross
pavel@ALABAMA:~/bbb_cross_toolchain_code$ ./testcross
Testing cross compilation for armhf
pavel@ALABAMA:~/bbb_cross_toolchain_code$

But in Eclipse it doesn’t work although I added -static in cross-compiler options.

Screenshot from 2020-09-23 15-46-33.png

Screenshot from 2020-09-23 15-47-45.png

Any comments ?

Thanks.

For some reason the images didn’t show up in mail…

/lib/ld-linux-armhf.so.3: No such file or directory

Regards,

Screenshot from 2020-09-23 15-46-33.png

Screenshot from 2020-09-23 15-47-45.png

Here is execution in eclipse:
Eclipse execution

Here is Eclipse compiler options:
Compiler options

Resolved.
-static isn’t compiler, but linker option.
Regards.

Execution
Options

Did you look on the book website?
http://exploringrpi.com/chapter7/

Look at the response by Brendan Lynskey regarding adding the following in your “~/.bashrc”
export QEMU_LD_PREFIX=/usr/arm-linux-gnueabihf

You could do this on the command line as well but it will not be persistent between logins.

Jon

Sorry, I see you already solved this and the link I provided was for the Pi and BB.
There is a message fairly recently at the BB version of the book regarding this issue:
http://exploringbeaglebone.com/chapter7/

Jon