cmd -> run -> make, which outputs: "make" is not recognized as an internal or external command,operable program or batch file" /> cmd -> run -> make, which outputs: "make" is not recognized as an internal or external command,operable program or batch file" />

Use make on windows

I have Windows 7 và tried lớn use the "make" command but "make" is not recognized as an internal or external command.

Bạn đang xem: Use make on windows

I did Start -> cmd -> run -> make, which outputs:

"make" is not recognized as an internal or external command,operable program or batch file.

Then I typed "mingw32-make" instead of "make" (Start -> cmd -> run -> mingw32-make) và I get the same output:

"mingw32-make" is not recognized as an internal or external command,operable program or batch file.

What shall I bởi next in order to lớn fix this problem?


windows cmd makefile
chia sẻ
Improve this question
Follow
edited Jul 29, 2019 at 4:14
*

Claire
3,10266 gold badges2121 silver badges3737 bronze badges
asked May 18, 2014 at 15:06
*

programmerprogrammer
4,0411313 gold badges4747 silver badges5959 bronze badges
8
| Show 3 more comments

12 Answers 12


Sorted by: Reset to mặc định
Highest score (default) Date modified (newest first) Date created (oldest first)
34
Your problem is most likely that the shell does not know where to lớn find your make program. If you want to lớn use it from "anywhere", then you must vì this, or else you will need to showroom the full path each time you want to điện thoại tư vấn it, which is quite cumbersome. For instance:

"c:program filesgnuwin32inmake.exe" option1=thisvalue option2=thatvalueThis is to be taken as an example, it used khổng lồ look like something like this on XP, I can"t say on W7. But gnuwin32 used khổng lồ provide useful "linux-world" packages for Windows. Kiểm tra details on your provider for make.

So to avoid entering the path, you can showroom the path khổng lồ your PATH environment variable. You will find this easily.To make sure it is registered by the OS, open a console (run cmd.exe) và entering $PATH should give you a menu of mặc định pathes. Kiểm tra that the location of your make program is there.


nội dung
Improve this answer
Follow
edited Oct 21, năm ngoái at 15:16
answered May 19, 2014 at 9:53
*

kebskebs
5,76144 gold badges3737 silver badges6666 bronze badges
2
địa chỉ a bình luận |
33
In Windows10, I solved this issue by adding C:MinGWin lớn Path & then called it using MinGW32-make not make.


cốt truyện
Improve this answer
Follow
edited Mar 8 at 17:49
*

Olivia Stork
4,49155 gold badges2525 silver badges3939 bronze badges
answered Jun 21, 2017 at 23:59
*

user61871user61871
75966 silver badges1313 bronze badges
2
add a comment |
27
+50
This is an old question, but none of the answers here provide enough context for a beginner to lớn choose which one lớn pick.

What is make?

make is a traditional Unix utility which reads a Makefile lớn decide what programs to lớn run lớn reach a particular goal. Typically, that goal is khổng lồ build a piece of software from a phối of source files & libraries; but make is general enough lớn be used for various other tasks, too, like assembling a PDF from a collection of TeX source files, or retrieving the newest versions of each of a menu of website pages.

Besides encapsulating the steps lớn reach an individual target, make reduces processing time by avoiding lớn re-execute steps which are already complete. It does this by comparing time stamps between dependencies; if A depends on B but A already exists & is newer than B, there is no need khổng lồ make A. Of course, in order for this to work properly, the Makefile needs to lớn document all such dependencies.

A: B commands khổng lồ produce A from BNotice that the indentation needs khổng lồ consist of a literal tab character. This is a common beginner mistake.

Xem thêm: Cách Làm Đất Trồng Cây - Cách Làm Đất Trồng Rau Trong Thùng Xốp Hiệu Quả

Common Versions of make

The original make was rather pedestrian. Its lineage continues khổng lồ this day into BSD make, from which nmake is derived. Roughly speaking, this version provides the make functionality defined by POSIX, with a few minor enhancements & variations.

GNU make, by contrast, significantly extends the formalism, to the point where a GNU Makefile is unlikely to work with other versions (or occasionally even older versions of GNU make). There is a convention to gọi such files GNUmakefile instead of Makefile, but this convention is widely ignored, especially on platforms lượt thích Linux where GNU make is the de facto standard make.

Telltale signs that a Makefile uses GNU make conventions are the use of := instead of = for variable assignments (though this is not exclusively a GNU feature) and a plethora of functions like $(shell ...), $(foreach ...), $(patsubst ...) etc.

So Which bởi vì I Need?

Well, it really depends on what you are hoping to lớn accomplish.

If the software you are hoping khổng lồ build has a vcproj file or similar, you probably want to lớn use that instead, & not try to use make at all.

In the general case, MinGW make is a Windows port of GNU make for Windows, It should generally cope with any Makefile you throw at it.

If you know the software was written lớn use nmake and you already have it installed, or it is easy for you lớn obtain, maybe go with that.

You should understand that if the software was not written for, or explicitly ported to, Windows, it is unlikely khổng lồ compile without significant modifications. In this scenario, getting make lớn run is the least of your problems, and you will need a good understanding of the differences between the original platform & Windows to have a chance of pulling it off yourself.

In some more detail, if the Makefile contains Unix commands lượt thích grep or curl or yacc then your system needs to have those commands installed, too. But quite apart from that, C or C++ (or more generally, source code in any language) which was written for a different platform might simply not work - at all, or as expected (which is often worse) - on Windows.