How to compile a C program for beagle board?

For compiling c file

arm-none-linux-gnueabi file-name.c

after that got the a.out file
file a.out

a.out: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped

but when i am load on beagle board
./a.out

it will show this error

./a.out: error while loading shared libraries: libgcc_s.so.1: cannot open shared object file: No such file or directory

Why not compile on the beagle directly?
Transfer the file and compile with "gcc *arm-none-linux-gnueabi file-name.c*"
Chad

on begalboard

gcc command not found

so i have to cross compile it

    For compiling c file

  arm-none-linux-gnueabi file-name.c

"gnueabi" = "armel"

For "armhf" you need "gnueabihf"...

after that got the a.out file
  file a.out

a.out: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically
linked (uses shared libs), for GNU/Linux 2.6.16, not stripped

but when i am load on beagle board
./a.out

it will show this error

./a.out: error while loading shared libraries: libgcc_s.so.1: cannot open
shared object file: No such file or directory

Either, install the slower "armel" multi-arch libc, or just use the
proper compiler..

Regards,

a.out: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped

As you see your executable is dynamically linked, this means at execution time, it will look for the libraries in your system. If the libraries are not in your system or not in the PATH your executable will not found it and you run into this problem.

Regards
–Allan Granados

*a.out: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically
linked (uses shared libs), for GNU/Linux 2.6.16, not stripped*

*As you see your executable is dynamically linked, this means at execution
time, it will look for the libraries in your system. If the libraries are
not in your system or not in the PATH your executable will not found it and
you run into this problem.*

you may like to test with ldd.

ldd a.out
        linux-vdso.so.1 => (0x00007fff655ff000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fc9c3f24000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fc9c427d000)

/*
  done on x86-64
*/

re,
wh