Hello and welcome!
your "error" is simple: the nslu does not have the same CPU as your Ubuntu
PC, so it cannot run programs compiled on your pc:
Your pc has a x86 cpu.
The slug has an ARM cpu.
You must either "cross compile" your program for the slug, or run a
on-slug-board gcc adapted to your slug.
1) cross compiling - that means using a gcc that runs on your pc but
generates code for the slug. personnally, I don't know where to find a
simple toolchain to do this - but other people here know it, i'm sure.
2) native compiling on the slug - this requires having added some swap on a
usb stick, then installing the following ipkgs, possibly from optware, I
don't know unslung (I'm a slugos user):
binutils binutils-symlinks cpp cpp-symlinks gcc gcc-symlinks
then you can run the gcc -o test test.c on the slug itself, and it will work
as expected (but not on a pc :) )
Regards
Sebastien
On Wed, Jun 17, 2009 at 10:47 PM, NeillHog <
Neill@...> wrote:
>
> Hello!
> This is my first posting and I apologise in advance for any rules I may,
> inadvertently, be breaking.
> I am definitely not a Linux guru but I am willing to learn.
>
> I wrote a quick test program
> #include <stdio.h>
> main()
> {
> printf("neill\n");
> }
>
> and compiled it on my kubuntu PC with gcc -o test test.c
> Then chmod 744 test and ./test
> It worked as expected.
>
> I then transferred the test program to my NSLU (with unslung) and did
> chmod 744 test and ./test
>
> The result was ./test: ./test: 1: Syntax error: "(" unexpected
>
> Could some one help me by explaining my error.
> Thank you in advance.
>
> Neill
>
> --
> View this message in context:
>
http://www.nabble.com/Running-a-C-program-tp24080049p24080049.html> Sent from the Nslu2 - Linux mailing list archive at Nabble.com.
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>