BeagleBone Black: Debian vs Angstrom C++ Executable Issue

884 views
Skip to first unread message

Stonewerk

unread,
May 13, 2014, 4:05:36 AM5/13/14
to beagl...@googlegroups.com
(Environment, tools, and configuration details are given at the end of this post).

I have created a simple C++ executable - the ubiquitous "Hello World" application - to run on my BeagleBone Black Rev. B. When executed properly, the program simply displays "Hello World!" on the terminal, and then exits.

The development platform is a PC running Ubuntu 12.04.4 LTS, with the Eclipse Indigo IDE, and arm-linux-gnueabi g++ cross compiler tool chain. The code is edited, compiled, and linked on the PC, then downloaded to the BBB for execution.

On my BBB running Angstrom, the program correctly executes, with it's behaviour as described above. The problem is that this executable behaves very differently when running under Debian; instead of displaying "Hello World", the following error message is displayed:

./HelloBeagleBone: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

My first thought is that I am missing a package or library on the Debian installation. However, when I compile the application directly on the BBB, using the native g++ compiler, it executes correctly.

As I write this, it (doubtfully) occurs to me that this *might* be a soft float vs. hard float issue - but the supported Debian BB image is not compiled for hard floats, is it?

Anyway, what is it I'm missing here? A library? A brain? Whuzzup?

The Angstrom build is that which came with the Rev B board on the eMMC; I have not "upgraded" to the latest version, yet.

The Debian build is the latest BeagleBone distribution, written to a microSD card.

As promised, details:

----------
DEVELOPMENT ENVIRONMENT:

Ubuntu:
Distributor ID:    Ubuntu
Description:    Ubuntu 12.04.4 LTS
Release:    12.04
Codename:    precise

Linux Kernel:
3.11.0-20-generic

Eclipse IDE
Indigo
Eclipse Platform
Version: 3.7.2
Build id: I20110613-1736

---------
DEVELOPMENT TOOLS:
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)

---------
BEAGLEBONE BLACK Rev. B ENVIRONMENT:

eMMC:
root@beaglebone:~# lsb_release -a
Distributor ID: Angstrom
Description:    Angstrom GNU/Linux v2012.12 (Core edition)
Release:        v2012.12
Codename:     Core edition

SD CARD:
Debian GNU/Linux 7
BeagleBoard.org BeagleBone Debian Image 2014-04-23

Robert Nelson

unread,
May 13, 2014, 7:03:46 AM5/13/14
to Beagle Board


On May 13, 2014 3:05 AM, "Stonewerk" <bbea...@gmail.com> wrote:
>
> (Environment, tools, and configuration details are given at the end of this post).
>
> I have created a simple C++ executable - the ubiquitous "Hello World" application - to run on my BeagleBone Black Rev. B. When executed properly, the program simply displays "Hello World!" on the terminal, and then exits.
>
> The development platform is a PC running Ubuntu 12.04.4 LTS, with the Eclipse Indigo IDE, and arm-linux-gnueabi g++ cross compiler tool chain. The code is edited, compiled, and linked on the PC, then downloaded to the BBB for execution.
>
> On my BBB running Angstrom, the program correctly executes, with it's behaviour as described above. The problem is that this executable behaves very differently when running under Debian; instead of displaying "Hello World", the following error message is displayed:
>
> ./HelloBeagleBone: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
>
> My first thought is that I am missing a package or library on the Debian installation. However, when I compile the application directly on the BBB, using the native g++ compiler, it executes correctly.
>
> As I write this, it (doubtfully) occurs to me that this *might* be a soft float vs. hard float issue - but the supported Debian BB image is not compiled for hard floats, is it?

Yes, we used the 'armhf' debian sub arch. So a gnueabihf compiler is required.

> --
> For more options, visit http://beagleboard.org/discuss
> ---
> You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Stonewerk

unread,
May 13, 2014, 7:08:34 AM5/13/14
to beagl...@googlegroups.com

Stonewerk

unread,
May 13, 2014, 7:34:14 AM5/13/14
to beagl...@googlegroups.com
Hi Robert.

I recompiled with the 'hf compiler. Now the code executes as expected on the BBB, running the latest Debian image.

I thought this might be the case (soft float vs. hard float), but also wanted to post this problem (and solution) for posterity as I am sure I am not the only one to encounter this issue.

Many Thanks!

ansari...@gmail.com

unread,
Jun 11, 2014, 12:39:12 PM6/11/14
to beagl...@googlegroups.com
Hi Stonewerk ,
 i have also the same problem for debian but i want to know the settings required in eclipse for 'hf compiler as previous settings for Angstrom gave me error/// will u pls. tell me how i can achieve this...if u r not using eclipse then also u can let me know me details of ur compiler and is it free?
Reply all
Reply to author
Forward
0 new messages