我是C / C ++编程语言的新手,到目前为止已经使用Code :: blocks程序编写和编译程序。但是我需要知道如何通过Windows命令提示符编译程序,因为我需要访问创建的汇编代码。我的编译器是mingw32-gcc.exe,mingw32-g ++。exe
答案 0 :(得分:3)
请阅读Compile Programs with MinGW -- A Guide for New Users。
要使gcc
生成汇编代码,请使用-S
选项:
祝你好运!-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.
答案 1 :(得分:2)
如果您使用mingw作为gcc编译器安装了代码块,请按照以下步骤进行操作