gpt4 book ai didi

windows - 如何通过 Windows 命令提示符编译 C/C++ 程序?

转载 作者:可可西里 更新时间:2023-11-01 09:56:32 26 4
gpt4 key购买 nike

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

最佳答案

请阅读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.

祝你好运!

关于windows - 如何通过 Windows 命令提示符编译 C/C++ 程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6281493/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com