How to compile C program on command line using MinGW?

前端 未结 14 1099
天命终不由人
天命终不由人 2021-01-30 17:19

What command does one have to enter at the command line in Windows 7 to compile a basic C program?

Like I am literally wondering what you type in the command prompt, to

14条回答
  •  无人及你
    2021-01-30 17:53

    I encountered the same error message after unpacking MinGW archives to C:\MinGW and setting the path to environment variable as C:\MinGW\bin;.

    When I try to compile I get this error!

    gcc: error: CreateProcess: No such file or directory

    I finally figured out that some of the downloaded archives were reported broken while unpaking them to C:\MinGW (yet I ignored this initially). Once I deleted the broken files and re-downloaded the whole archives again from SourceForge, unpacked them to C:\MinGW successfully the error was gone, and the compiler worked fine and output my desired hello.exe.

    I ran this:

    gcc hello.c -o hello
    

    The result result was this (a blinking underscore):

    _

提交回复
热议问题