当我编译.c文件时,它总是创建名称为'a'的.exe文件. [英] When I compile .c file it always creates .exe file with name 'a'

查看:52
本文介绍了当我编译.c文件时,它总是创建名称为'a'的.exe文件.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用GCC编译器在CMD上编译和运行C程序. 当我使用命令gcc hello.c编译C程序时,它将创建一个名为a.exe的可执行文件文件,但是当我使用IDE时,它将使用与.c文件相同的名称作为hello.exe. 是否可以在CMD上创建与.c文件相同的.exe文件名?

I use GCC compiler to compile and run C program on CMD. When I compile C program using command gcc hello.c it creates an executable file file with name a.exe but when I use IDE it uses the name same as .c file as hello.exe. Is it possible to create .exe file name same as .c file on CMD?

推荐答案

只需告诉GCC您想要的输出名称.

Just tell GCC the output name you want.

gcc hello.c -o hello

这篇关于当我编译.c文件时,它总是创建名称为'a'的.exe文件.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆