LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 09-28-2010, 05:25 AM   #1
asprakash
Member
 
Registered: May 2006
Location: Chennai, India
Posts: 74
Blog Entries: 3

Rep: Reputation: 18
Busybox Syntax error: word unexpected (expecting ")")


Hi,
When I tried compile an simple hello world program on ARM9 board by using Busybox 1.15.3, I am getting the error,
Syntax error: word unexpected (expecting ")")

"file busybox" output:: busybox: ELF 32-bit LSB executable, ARM, version 1, statically linked, for GNU/Linux 2.4.3, stripped

"file Hello" output:: hello: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.14, not stripped


Help me solve the issue.

-Prakash
 
Old 09-28-2010, 05:27 AM   #2
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
Probably would be a good idea to show us the source code of this program you're trying to compile; the error might be just as simple as it reads: You're missing a ")" somewhere. Shouldn't be hard to spot, but it would help to see the code.
 
Old 09-28-2010, 07:59 AM   #3
asprakash
Member
 
Registered: May 2006
Location: Chennai, India
Posts: 74

Original Poster
Blog Entries: 3

Rep: Reputation: 18
Hi,
Its an simple hello world program using by C language.

/********************************/
#include<stdio.h>
void main()
{
printf("Hello world\n");

}
/*******************************/

Tested the above program in x86. Its working fine.
I guess there is something wrong to the library links.
It is not helpful for me, http://www.mail-archive.com/uclibc@u.../msg03394.html

-Prakash

Last edited by asprakash; 09-28-2010 at 08:07 AM. Reason: Add few more informations
 
Old 09-28-2010, 08:10 AM   #4
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
Hm, that is odd.

Not sure what to suggest, but the program compiled and ran for me (yes, totally different architecture), and here's the `file` and `ldd` info, in case it helps at all:
Code:
sasha@reactor: gcc -o hello hello.c
sasha@reactor: hello
Hello world
sasha@reactor: ldd hello
        linux-vdso.so.1 =>  (0x00007fff4cbff000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f0c30061000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f0c303d6000)
sasha@reactor: file hello
hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), not stripped
sasha@reactor:
 
Old 09-28-2010, 09:38 AM   #5
asprakash
Member
 
Registered: May 2006
Location: Chennai, India
Posts: 74

Original Poster
Blog Entries: 3

Rep: Reputation: 18
Thanks for the hint.
Seems, the binary on ARM is looking for some libraries. I tried the same ldd for ARM version of hello executable. But getting the error,
ldd: exited with unknown exit code (126)

-Prakash
 
1 members found this post helpful.
Old 10-02-2010, 05:40 AM   #6
jf.argentino
Member
 
Registered: Apr 2008
Location: Toulon (France)
Distribution: FEDORA CORE
Posts: 493

Rep: Reputation: 50
This is something like binaries incompatibility, IMHO nothing to deal with busybox, busybox is just a light version of useful tools for embedded system. I'll look to the cross-compiler version used for the libc of your target and the libc you're linking your application with....
 
1 members found this post helpful.
Old 10-13-2010, 02:22 AM   #7
asprakash
Member
 
Registered: May 2006
Location: Chennai, India
Posts: 74

Original Poster
Blog Entries: 3

Rep: Reputation: 18
[Solved]

You are correct.
I copied the libc and ld-linux library from the arm cross-compiler libc into my target root filesystems /lib. Now the program is working fine.

-Prakash
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Shell Scripting "syntax error : unexpected end of file" roxie600 Programming 12 04-30-2010 12:18 AM
syntax error unexpected token near "then" pclimmex Linux - Newbie 1 06-20-2008 10:51 PM
chmod: 1: Syntax error: "(" unexpected - what's this mean and how do I fix it? SeriesOne Linux - Newbie 6 02-22-2008 01:18 PM
Backup Script error "line 31: syntax error: unexpected end of file" eswanepoel General 7 12-07-2007 09:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 08:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration