Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/57.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在一行中从终端运行.c程序?_C_Gcc_Terminal_Mingw_Execution - Fatal编程技术网

如何在一行中从终端运行.c程序?

如何在一行中从终端运行.c程序?,c,gcc,terminal,mingw,execution,C,Gcc,Terminal,Mingw,Execution,我在Windows10上使用Min GW GCC编译器。每次编译时,我都需要生成一个.exe,然后运行它。有什么方法可以一步完成整个任务吗?您可以像在linux或macos上一样在windows中组合命令 gcc compilefile && c:/executefile.exe (您需要用min gw和您的exe路径替换这些内容) 链接: gcc file.c-o file.exe&./file?或者,tcc可以运行C、TOOLMAKE或编写一个小型C程序,使用stdl

我在Windows10上使用Min GW GCC编译器。每次编译时,我都需要生成一个.exe,然后运行它。有什么方法可以一步完成整个任务吗?

您可以像在linux或macos上一样在windows中组合命令

gcc compilefile && c:/executefile.exe
(您需要用min gw和您的exe路径替换这些内容)

链接:


gcc file.c-o file.exe&./file
?或者,tcc可以运行C、TOOLMAKE或编写一个小型C程序,使用
stdlib.h
中的
system()
发送shell命令来编译和执行!这个问题可能与主题不太相关…获取一些,其中有许多问题。
&&
仅适用于PS7和cmd提示符。--或者使用脚本、make或此处建议的其他选项。