Tiny Core Linux

Tiny Core Extensions => TCE Talk => Topic started by: Marco Trapanese on August 24, 2010, 10:04:34 AM

Title: Errors when launch executables
Post by: Marco Trapanese on August 24, 2010, 10:04:34 AM
Hello,

I'm experimenting about developing C application from a development machine.
My desktop is running Ubuntu 10.04 while the target machine is running Tinycore.

I did this simple test:

1) wrote helloworld.c (the obvious one)
2) create the makefile
3) compiled and tested on the dev machine
4) copied the executable to the target machine

I got:

./helloworld: line 1: syntax error: unexpected "("

then,

5) copied the source and makefile files to the target machine
6) compiled there
7) successfully ran

So, it seems I can't run a very simple program not compiled on Tinycore.
Both make are GNU Make 3.81

Any idea?
Marco
Title: Re: Errors when launch executables
Post by: tinypoodle on August 24, 2010, 10:27:48 AM
That is one potential conclusion from all you say.
An equally reasonable one would be that it seems you can't run a very simple program compiled under ubuntu on a different system.   ;)
Title: Re: Errors when launch executables
Post by: Marco Trapanese on August 24, 2010, 02:28:38 PM
Yeah, but how to find out why?
Title: Re: Errors when launch executables
Post by: Jason W on August 24, 2010, 02:59:22 PM
Are the two machines of similar cpu?   Sounds like an architecture issue on my first guess.  

Did you specify -march when compiling?
Title: Re: Errors when launch executables
Post by: Marco Trapanese on August 25, 2010, 03:37:25 AM
I have two desktop PC with Ubuntu. The first has an AMD64 CPU, the second an Intel Pentium T2370 - 32 bit.
*Both* are running the 32 bit version of Ubuntu.

The target machine is an Asus eeePC with Atom.

Any code compiled with the desktop computers will run on both of them, but won't in Tinycore.
To be sure I tried to add the -m32 flag but with no effect.
Title: Re: Errors when launch executables
Post by: Marco Trapanese on August 25, 2010, 10:40:45 AM
I asked the same question into an Ubuntu forum.
But nobody could explain the behavior nor the cause of the error.

Anyway, I tried-tried-retried again, I rebooted several times both machines and eventually it works!

Honestly, I can't understand why. The executable was always the same (only a printf ("Hello World!\n")) and I didn't change anything in the makefile  ???

Title: Re: Errors when launch executables
Post by: ^thehatsrule^ on August 28, 2010, 12:33:20 AM
Most likely it was a 64-bit executable (I got the same error message here).
Title: Re: Errors when launch executables
Post by: smultita on September 01, 2010, 09:24:57 AM
Maybe this is a fix ?
http://forum.tinycorelinux.net/index.php?topic=7044