Tiny Core Linux
Tiny Core Extensions => TCE Talk => Topic started 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
-
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. ;)
-
Yeah, but how to find out why?
-
Are the two machines of similar cpu? Sounds like an architecture issue on my first guess.
Did you specify -march when compiling?
-
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.
-
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 ???
-
Most likely it was a 64-bit executable (I got the same error message here).
-
Maybe this is a fix ?
http://forum.tinycorelinux.net/index.php?topic=7044