c - 如何使用 Oracle Solaris 10 1/13 s10s_u11wos_24a SPARC 在 C 中编译此程序
问题描述
大家好,我正在尝试正确编译 C 程序,但是当我运行程序时抛出错误无效参数。
我试图把架构类型像 -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 运行时和库链接以创建可加载的可执行文件。
你需要更多类似的东西:
cc -o Prueba Prueba.c
chmod 777 Prueba
./Prueba
推荐阅读
- reactjs - 使用 React 有什么好处?
- c - 找不到灵活统计的计算主代码体
- javascript - VueJs 属性未显示在模板中但存在于数据中
- django - 如何隐藏 SECRET_KEY?
- java - 在缓冲图像上填充颜色时出错
- javascript - 如何在不安装运行时导入其他js文件
- python - 摆脱 Pandas Dataframe 中列中的重复字符串
- python-3.x - 如何创建元组的循环引用?
- javascript - 检查元素是否与 JavaScript 中的条件对应
- javascript - 使用纯 Javascript 或 JQuery 的 Google OAuth 2 访问令牌