如果我这样做gcc filename.c,我得到a.out
执行后gcc -o output_name filename.c我们得到可执行文件output_name。
这个文件的扩展名是什么?
与 Windows 不同,Linux 不依赖于文件的扩展名来确定它是什么类型的文件。相反,它将检查文件的前几个字节并确定它是什么类型的文件。
因此,通过给定的输出文件的gcc要求没有扩展名。您可以添加您想要的任何扩展名(通过更改-o output_name为 say -o output_name.abcd),但这不会有任何区别。
你可以看看命令的输出
file ./filename
Run Code Online (Sandbox Code Playgroud)
例如
:~$ file output_file
output_file: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=9bc9fabf05a3d2e58c7780c48cd873cb2955b2ec, not stripped
:~$
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1846 次 |
| 最近记录: |