如何通过Windows命令提示符编译C / C ++程序? [英] How do I compile a C/C++ program through windows command prompt?

查看:266
本文介绍了如何通过Windows命令提示符编译C / C ++程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

新的C / C ++编程语言,迄今为止已经使用Code :: blocks程序编写和编译程序。但是我需要知道如何通过Windows命令提示符编译程序,因为我需要访问创建的汇编代码。我的编译器是mingw32-gcc.exe,mingw32-g ++。exe

Im new to the C/C++ programming language an so far have used the Code::blocks program for writing and compiling programs. However I need to know how to compile a program via windows command prompt as I need to access the assembly code created. My compilers are mingw32-gcc.exe, mingw32-g++.exe

推荐答案

请阅读使用MinGW编译程序 - 新用户指南
要使 gcc 生成汇编代码,请使用 -S 选项:

Please read Compile Programs with MinGW -- A Guide for New Users. To make gcc produce assembler code, use -S option:


   -S  Stop after the stage of compilation proper; do not assemble. The output is in the form of an assembler code file for each non-assembler input file specified.

       By default, the assembler file name for a source file is made by replacing the suffix .c, .i, etc., with .s.

       Input files that don't require compilation are ignored.


祝你好运!

这篇关于如何通过Windows命令提示符编译C / C ++程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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