Hello world application is missing library libstdc++.so.6

Hi, I try to follow the “hello world” application example on my new Digi Connect ME9210 using Digi ESP for Embeded Linux.

After spending some time upgrading from 5.0 to 5.2 and setting it all up, all is well until it tries to run the program /tmp/hello_world on the target. The Remote Console shows:

/tmp/hello_world: can’t load library ‘libstdc++.so.6’

What to do?

Thanks

Hi Tore,
so there are several approaches, but first of all I have to ask:
Did you made already kernel project for your target device?
If Yes go to the rootfs ->lib folder and check is this library persists there. if no-> find where it is (somewhere in /usr/local/DigiEL-5.0) and copy it. after that make kernel project update rootfs in the digi module, and should works :slight_smile:
I wandering why for hello world project such library is searched for?

why don’t you try
export path :
gandalf@damage:~/workspace/$ export PATH=$PATH:/usr/local/DigiEL-5.0/usr/bin

compile project:
gandalf@damage:~/workspace/$ arm-linux-gcc helloworld.c -o helloworld

gandalf@damage:~/workspace/$ scp helloworld root@targetIPadress:/tmp
pass:root
in the shell of Digi module
/ # ./tmp/helloworld

try package manager again and update everything through it… restart the workspace and create a new “Hello World” project… it will solve this i believe

Thanks,

Command line compilation works fine. I also made a new “hello” project that worked fine. It is when I make a c++ project with a hello.cpp file that I get this library error message.

I have upgraded to DigiEL-5.2 on my Ubuntu host. The file exists here under /usr/local/Digi5.x/usr/arm-linux-uclibc/lib in both versions, but is nowhere to be found on the ME9210.

I have not made a “kernel project”? You say: “if no-> find where it is (somewhere in /usr/local/DigiEL-5.0) and copy it. after that make kernel project update rootfs in the digi module, and should works :)”.

“Copy” where?
“kernel project update rootfs”?

Maybe I have some more reading to do…

Hi,

I’m still working on getting the C++ version of “hello_world” to go.

I have managed to make a new kernel/rootfs project using only defaults (nothing changed), and the ME9210 can boot using TFTP and has the filesystem on the host using NFS.

Q1: Regarding this default kernel, I noticed that the “scp” command is no longer working (this works when I boot the old kernel from FLASH). What to do?

Next I try to change the rootfs by adding the library file “libstdc++.so.6” to the project and then copy the file /usr/local/DigiEL-5.2/usr/arm-linux-uclibc/lib/libstdc++.so.6 to ./workspace/kernel/build/rootfs/lib.

Next is build project, and the following message comes up:
Project Build: Digi Embeded Linux project “…” build process stopped because some new confirguration options were detected.
Digi Embeded Linus Config tools is going to be opened… OK

Next dialog is:
cONFIGURE pROJECT: Error while trying to autodetect the desktop system. Set the configuration target value in the Graphic Window System section of DigiEL Configuration under menu Window->preferences.

Q2: Set to what?

Next I simply try to copy the library file to the rootfs in the /exports directory since this is mounted by the ME9210.

Next I run the compiled “hello.cpp” program. This Time it says “Illegal instruction”.

Q3: Is libstdc++.so.6 no good?

I see that libstdc++.so.6 is about 2.5 Mbyte, which is too large for the ME9210, so this whole C++ endeavour may be futile anyway.

Q4: Do I have to use C (and not C++) for my application?

If NO:

Q5: How to get around libstdc++.so.6?

And Yes bobthomas13, I have updated packages and made several new projects. Thanks for still reading …


Project Build: Digi Embeded Linux project “…” build process stopped because some new confirguration options were detected.

Hmm, looks like you did not close config window of kernel project or something before you start build rootfs. I had similar warnings in such situation.


Q1: Regarding this default kernel, I noticed that the “scp” command is no longer working (this works when I boot the old kernel from FLASH). What to do?

Read the docs;) or compare settings of “old kernel” and the new one from your project.


I see that libstdc++.so.6 is about 2.5 Mbyte, which is too large for the ME9210, so this whole C++ endeavour may be futile anyway.

Well, you have an embedded device, and you have to deal with limits. I’m not expert in the linux programming, but is there some way to rebuild library in such way that, only used components to exist? because 2.5MB i a lot of info.

The error is because you do not have this library in your rootfs. The easiest way to get it in is to build your own kernel/rootfs first by creating a new u-boot/kernel/rootfs project and adding cpp example in to rootfs through project configuration screen, You will then be able to run your own c++ apps.

Please make sure you include hello_world_cpp_libstd example as part of your U-boot/Kernel/rootfs project using “configure project” screen:
Create new Kernel/rootfs/Uboot project:
go To File->New->Digi EL Kernel/rootfs/U-boot Project

Fill out all the fields on the next screen, then select checkboxes next to kernel, rootfs, and applications.

Fill out the next screen as follows.

Then click Finish. Right click on the new project and select “configure project”.
“configure project” screen:

In configuration window scroll all the way down to Application Configuration->Application templates and select checkmark next to hello_world_cpp_libstd and optionaly gpio_test, rtc_test,helloworls, etc:

Save then close this window. Now you are ready to build –right click on the project then select “Build project”

Next do “Install Project”

If configured properly , this will copy binary images to /tftpboot and create a rootfs folder for your platform in /exports folder. Now you can use “dboot linux tftp” command to boot your module – it will download kernel image over tftp and then mount rootfs from the platfoprm folder in your host’s /exports folder.

You should now have your own kernel and your own rootfs with all of the above samples.

In this case libstdc++ library will be automatically stripped and added to your rootfs:

BusyBox v1.11.3 (2008-10-06 12:01:16 CEST) built-in shell (ash)
Enter ‘help’ for a list of built-in commands.

/ # ls -la /lib/libstdc++.so.6
lrwxrwxrwx 1 root root 18 Jan 13 2009 /lib/libstdc++.so.6 -> libstdc++.so.6.0.7
/ #

/ # ls -la /lib/libstdc++.so.6.0.7
-rwxr-xr-x 1 root root 516080 Jan 13 2009 /lib/libstdc++.so.6.0.7
/ #

Regards,
Leonid