How can I compile C files into an executable (.exe) file?

后端 未结 4 1353
予麋鹿
予麋鹿 2021-01-19 19:35

I am unsure about compiling C files into executables by using Cygwin under Windows 7.

Can anyone please tell me how to do this?

I\'ve read some tutorials but

4条回答
  •  青春惊慌失措
    2021-01-19 20:32

    There are several ways to compile c-files. Makefiles are just one possibility. But as you proposed it... Here are two tutorials for Makefiles:

    1. http://makepp.sourceforge.net/1.19/makepp_tutorial.html
    2. http://mrbook.org/tutorials/make/ (Content from 2012 accessable via waybackmachine)

    But note, that you will also need a compiler (installed under cygwin).

    Another possibility is to use Dev-C++, a IDE (Integrated Developement Environment) for C++. Once installed you can create a project and add your source code, and just compile the project. It also contains a c++ compiler (also supports C), which is named mingw. The makefile needed is automatically generated. So that's simpler for beginners.

    You can download Dev-Cpp here: http://www.bloodshed.net/devcpp.html

    Note: As you spoke about cygwin I assume you use Windows. Dev++ works only under windows, and you wont need cygwin.

提交回复
热议问题