Your toolchain does not have a static c library, or the linker cannot find it. You either need to specify the path to libc.a or you cannot link statically.

In the first example, you tried to execute hello through the shell, which is why you got the missing ')'. You should just do "/sdcard/hello", *not *"sh /sdcard/hello"

Jerome

On 26/05/2010 1:34 AM, akhilesh kumar wrote:
Hi Rogerio,

Thank you for your reply,


when iam trying to build my hello program as a static one it is giving the below error.

#agcc  -o  hello hello.c -static
/home/naveen/akhilesh/mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.2.1/bin/../lib/gcc/arm-eabi/4.2.1/../../../../arm-eabi/bin/ld: cannot find -lc
collect2: ld returned 1 exit status


below one is the source code for hell.c
main()
{
}



Best regards,





2010/5/25 Rogério de Souza Moraes <rogerio.so...@gmail.com <mailto:rogerio.so...@gmail.com>>

    Hi Akhilesh,

    Post the code that is in the hello.c, it make easier to help you.
    You can try to compile the program statically:

    *agcc hello.c -static -o hello*

    In this way you avoid to have wrong library links.

    Regards,

    Rogerio

    2010/5/25 akhilesh kumar <akhipa...@gmail.com
    <mailto:akhipa...@gmail.com>>


        Hi All,

        I have compiled my simple "hello world"  application from
        android arm tool chain
        (mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin)

        *$ agcc hello.c -o hello

        *Now I  am trying to run hello world application on android
        emulator form using sdcard mount .
        and I am getting the following error

        # sh /sdcard/hello
        /sdcard/hello: 1: Syntax error: word unexpected (expecting ")")

        please guide me how to resolve this problem.
-- Thanks,
        Akhilesh
-- unsubscribe: android-porting+unsubscr...@googlegroups.com
        <mailto:android-porting%2bunsubscr...@googlegroups.com>
        website: http://groups.google.com/group/android-porting





--
Thanks,
Akhilesh
--
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-porting

--
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-porting

Reply via email to