我如何使用 Oracle Solaris 10 1/13 s10s_u11wos_24a SPARC 在 C 中编译这个程序

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

大家好我正在尝试正确编译 C 程序,但是当我 运行 程序抛出错误 Ivalid Argument。

我尝试将体系结构类型设置为 -xarch=sparc 或 -m64 但什么也没有

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

您已将 C 文件编译为目标模块,而不是编译并链接到 C run-time 和库以创建可加载的可执行文件。

你需要更多类似的东西:

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