WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Errors when launch executables  (Read 2470 times)

Offline Marco Trapanese

  • Newbie
  • *
  • Posts: 28
Errors when launch executables
« 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

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Errors when launch executables
« Reply #1 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.   ;)
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline Marco Trapanese

  • Newbie
  • *
  • Posts: 28
Re: Errors when launch executables
« Reply #2 on: August 24, 2010, 02:28:38 PM »
Yeah, but how to find out why?

Offline Jason W

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 9730
Re: Errors when launch executables
« Reply #3 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?
« Last Edit: August 24, 2010, 03:03:06 PM by Jason W »

Offline Marco Trapanese

  • Newbie
  • *
  • Posts: 28
Re: Errors when launch executables
« Reply #4 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.

Offline Marco Trapanese

  • Newbie
  • *
  • Posts: 28
Re: Errors when launch executables
« Reply #5 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  ???


Offline ^thehatsrule^

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 1726
Re: Errors when launch executables
« Reply #6 on: August 28, 2010, 12:33:20 AM »
Most likely it was a 64-bit executable (I got the same error message here).

Offline smultita

  • Newbie
  • *
  • Posts: 13
    • EmbLin
Re: Errors when launch executables
« Reply #7 on: September 01, 2010, 09:24:57 AM »
« Last Edit: September 01, 2010, 09:27:30 AM by smultita »