Search code examples
csolarissparc

How can I compile this program in C with Oracle Solaris 10 1/13 s10s_u11wos_24a SPARC


Hello everyone Im triying to compile a C program correctly, but when I run the program throw the Error Ivalid Argument.

Im tried to put the architecture type like -xarch=sparc or -m64 but nothing

bash-3.2$ cc -c Prueba.c -o Prueba.o -xarch=sparc
bash-3.2$ chmod 777 Prueba.o
bash-3.2$ ./Prueba.o
bash: ./Prueba.o: Invalid argument
bash-3.2$ cat /etc/release
                   Oracle Solaris 10 1/13 s10s_u11wos_24a SPARC
  Copyright (c) 1983, 2013, Oracle and/or its affiliates. All rights reserved.
                            Assembled 17 January 2013

Solution

  • You have compiled a C file to an object module rather than compiling and linking with the C run-time and library to create a loadable executable.

    You need something more like:

    cc -o Prueba Prueba.c
    chmod 777 Prueba
    ./Prueba