Makefile error on windows

三世轮回 提交于 2019-11-28 07:28:27

问题


I am trying to run makefile on windows7. I have added make.exe in windows path variable and I am trying to run "make -f makefile.txt" but it shows error

"cc -o edit main.o kbd.o command.o display.o insert.o search.o files.o utils.o
process_begin: CreateProcess(NULL, cc -o edit main.o kbd.o command.o display.o i
nsert.o search.o files.o utils.o, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [edit] Error"

Please help me as i am new to make concept.


回答1:


It is not sufficient to just add make.exe to the path. Your problem is that cc can not be found while trying to make the target called edit. Try running the same command from an MinGW/MSYS or CygWin shell, depending on how you installed this. That will most likely give you the proper environment to use make with this makefile.

This issue is similar to copy a file using a makefile at runtime




回答2:


To make it work install MinGW (mingw-get-setup.exe) which will install mingw-get.exe utility that could be used to install all needed build tools.

With C:\Mingw\bin (or whatever path selected during installation) on $PATH type in console:

$ mingw-get.exe gcc g++ msys-base  

After it finishes MSYS env will be available with all necessary tools (execute C:\MinGW\msys\1.0\msys.bat to open it)

Now you can use make like in unix envs.

Mike@Mike-PC ~
$ make
make: *** No targets specified and no makefile found.  Stop.


If it is not enough install mingw32-make as well with mingw-get.

来源:https://stackoverflow.com/questions/12991339/makefile-error-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!