简体   繁体   中英

Compile C File Using Makefile On Windows

I have a project with a .c file and a Makefile containing "compilation rules" for the gcc compiler. I'm having trouble finding a way to compile it into an executable on my Windows 8 machine. It was straight-forward on Ubuntu .

It should also be as simple as installing gcc and using the command line to switch to that directory and using the make command.

I'm stuck at the installation part since I can't find an easy or well documented solution.

Please suggest me a piece of software for this task. I do need step-by-step instructions to make the make command available on the command line globally using eg MinGW since it doesn't do it itself nor tells anything about it.

You need to modify the PATH variable so it includes the directory for your MinGW binaries:

C:\>echo %PATH%
...;D:\bin-win64\mingw64\bin;...

For more information, see

https://superuser.com/questions/502358/easier-way-to-change-environment-variables-in-windows-8

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM