Cross compiling using Eclipse and Ubuntu 64bit 12.04

I have done Derek Malloys tutorial on setting up Eclipse 3 times and still cannot get my program to execute on the Beaglebone. I am not using the BBB. I get an error message “No such file or directory” when I try to execute the file. I have read a few INTERNET files about the problem but no solution. If you can help it would be appreciated. I am a novice Linux and Eclipse user .

Thanks

I am not using the BBB

Does this mean you’re using a beaglebone white ? The error message can be related to a couple things. One of which could be due to using the wrong ABI for your system.

Sounds like you built your application with the wrong "abi"

What gcc compiler did you use and what OS are you running on your board?

Regards,

I am running 64 bit Ubuntu 12.04 on my laptop and 32 bit Ubuntu 12.04 on the Beaglebone. The C++ compiler is arm-linux-gnueabi-g++
.

The compiler version is 4.6. When I compile the program I see the compiled file in my project listed as HelloWorldTest [arm/le]. I Derek’s video he shows the messages that indicate a succesful compile and the messages I receive match his word for word.

You mentioned the wrong ABI. Is this something I need to install? I have not installed an ABI unless it is installed by default with Ubuntu or Eclipse.

"4.6" What "build" of "4.6"...

Please be more specific.

Regards,

While you’re at it, what kernel version are you using, and where did the image you’re using come from ?

The gcc toolchain you’re using determines what ABI you’re using.

Is this the compiler info you need. i’m a Linux novice so it may not be what you want.
compiler -I/usr/arm-linux-gnueabi/include/c++/4.6.3 -O0 -g3 -Wall -c -fmessage-length=0

Linux kernal - Linux ubuntu 3.2.0-67-generic #101-Ubuntu SMP Tue Jul 15 17:46:11 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

I downloaded the 12.04 version of Ubuntu from Ubuntu’s website.

Ok, now run this:

ldd /bin/ls

This should tell you which ABI is physically running on your board. It should be either arm-linux-gnueab or arm-linux-gnueabhf

If the output of ldd /bin/ls is arm-linux-gnueab then you’re golden. However I suspect the output will be arm-linux-gnueabhf. IN which case you’re using the wrong toolchain.

If the output is confusing to you, just paste the output in a message to us, and we can let you know.

Thanks for your help William. I actually have a bigger problem now. I decided to upgrade to 14.04.1 LTS. Something happened during the upgrade and trashed Ubuntu. I will reinstall Ubuntu this time using 32bit instead of 64bit Ubuntu. I really only run Ubuntu for programming microprocessors like the Beaglebone so a slight decrease in speed is not a big issue. This will eliminate any 64bit to 32bit cross compile problems.

I just did this myself using Lubuntu 14.04, and it works fine. I have not setup remote debugging yet, but I’m very sure it’ll work just like the rest works.

Lubuntu 14.04 is pretty much just Ubuntu 14.04, with LDXE instead of Unity. Since I have a very strong dislike for Unity . . .Anyhow I did a lot of testing between Ubuntu, Lubuntu, Xubuntu, and they all seem to use the same package repo’s. The only difference is the window manager they each use.

Lubuntu 14.04 with xcompmgr + cairo-dock looks far better than Ubuntu with Unity, and it is lightning fast. Even on my laptop with Intel 4500HD integrated graphics. Which is around maybe 5-6 years old ?

After installing Ubuntu 14.04 I ran the ldd /bin/ls command and this is the output.

libselinux.so.1 => /lib/arm-linux-gnueabihf/libselinux.so.1 (0xb6f6e000)
librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0xb6f5f000)
libacl.so.1 => /lib/arm-linux-gnueabihf/libacl.so.1 (0xb6f51000)
libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb6f2f000)
libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6e4b000)
/lib/ld-linux-armhf.so.3 (0xb6f94000)
libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb6e40000)
libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb6e24000)
libattr.so.1 => /lib/arm-linux-gnueabihf/libattr.so.1 (0xb6e18000)

How do I change the toolchain?

thanks

I am a little confused. When I ran the ldd /bin/ls command on the Beaglebone it shows I am using the the arm-linux-gnueabhf. I ran the same command on my desktop and it shows this output.
linux-gate.so.1 => (0xb7734000)
libselinux.so.1 => /lib/i386-linux-gnu/libselinux.so.1 (0xb76fb000)
libacl.so.1 => /lib/i386-linux-gnu/libacl.so.1 (0xb76f2000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb7541000)
libpcre.so.3 => /lib/i386-linux-gnu/libpcre.so.3 (0xb7503000)
libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xb74fe000)
/lib/ld-linux.so.2 (0xb7735000)
libattr.so.1 => /lib/i386-linux-gnu/libattr.so.1 (0xb74f8000)

I am compiling on the desktop and then copying the compiled program to the Beaglebone. When I compile the program on the desktop the size is 66,018 for my HelloWorld program. The compiled file is listed like this HelloWorld - [arm/le]. What I noticed is I have a compiled version of the same source file made using the vi program on the Beaglebone and the size of the compiled file is 8,951. It seems like although on my desktop has HelloWorld - [arm/le] it’s like the file is part x86 and part ARM or all x86. How do I resolve my toolchain problem? I am new to Linux and Eclipse.

I finally got it working. I deleted Eclipse and reinstalled it. I had two issues. #1 When I created my project instead of using Cross Toolchain I used Linux. In the Derek Molloy video when he creates his project he only has the Linux Toolchain listed so not knowing much about Ubuntu or Eclipse I followed the video. I also changed the toolchain to gneuabihf. Once I made these two changes everything started working. The good news is I learned a lot about Ubuntu and Eclipse during the process and now feel more comfortable with both products.

Pretty much my experience too mrbar – and I’m still trying to get up to speed on all of the parts involved in cross-compiling.
Congratulations of getting everything to work!