1

Saw previous answers on the subject, but wasn't able to get the solutions working fully myself. Trying to run code I pulled off Github from David R. Miller regarding his evolutionary neural network simulation software. Running Windows 10 and get the following error when attempting to run the provided makefile:

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

To be specific, I open the command window, cd to the folder where I saved the makefile, and type "make," "make all," and other variations. In looking at Google and other Stack Overflow answers I verified I have GnuWin32 in my program files (x86) folder and added the makefile directory as a path variable: enter image description here enter image description here

Not particularly familiar with windows systems or systems configurations in general so tracking I may be lacking something else.

Any ideas what I'm missing?

Github source code: https://github.com/davidrmiller/biosim4

Previous answer referenced: Windows 7 - 'make' is not recognized as an internal or external command, operable program or batch file

Korle Akiti
  • 43
  • 1
  • 1
  • 4
  • 1
    A makefile is not a program you run, so you don't need to have its directory on your PATH. You run the `make` program, and that program will read the makefile and do what it says. So you need the directory containing the `make` program to be on your PATH. – MadScientist Sep 26 '22 at 18:34
  • 1
    The error you see means the make command `make.exe` is not in any directory that's on your `PATH`. Have you installed `make`? It doesn't come with Windows so you'll have to install it yourself somehow, either by itself or as part of another set of tools. Once installed, find out what directory it's in. Then in the command window where you type `make`, look at the value of `PATH` (via something like `echo %PATH%` if it's a Windows terminal). Make sure the directory where `make.exe` is, is one of the directories in `PATH`. – MadScientist Sep 26 '22 at 18:35
  • 1
    BTW, in general please don't post images to SO questions. Please cut and paste text, especially for command-line tools like `make`. – MadScientist Sep 26 '22 at 18:36
  • 1
    I looks like you did not add an entry for the bin folder in your `PATH` environment variable. Note: that there is a user `PATH` environment variable and a OS / system one which combine. – drescherjm Sep 26 '22 at 19:09

1 Answers1

2

If your make executable is in C:/Program Files (x86)/GnuWin32/bin, add it to your path.

The purpose of "add path" is for convenience for your later use.

Assume your make executable is located in C:/Program Files (x86)/GnuWin32/bin/make.

Before you add the path you need to call:

C:/Program Files (x86)/GnuWin32/bin/make

After you add the path you need to call:

make

[Note]

If you are familiar with programming in Linux, I highly recommend msys2.

It provide a package manager pacman that you can easily update your tool chain and libraries. (g++, make, cmake, etc)

cpprust
  • 110
  • 4
  • 1
    Thanks for the help! Downloaded msys2 and `make` and I may be misinterpreting you, but I see a `make-4.3-3` folder in my msys64 folder (`C:\msys64\var\lib\pacman\local\make-4.3-3`). Do I need to copy this into the `C:/Program Files (x86)/GnuWin32/bin/` folder? (Btw: are those supposed to be backward slashes? I'm not sure if there's a difference between windows and Linux file path syntax) – Korle Akiti Sep 27 '22 at 12:26
  • MSYS2 use `pacman` to install & update everything, it is locate at `C:\msys64\usr\bin\pacman`. You'll can get the help with `C:\msys64\usr\bin\pacman --help`. Call `pacman -S mingw-w64-x86_64-make` to get `C:\msys64\mingw64\bin\mingw32-make`. For convenience, I'll add `C:\msys64\usr\bin` and `C:\msys64\mingw64\bin` to my path. So that I can call `pacman` and `mingw32-make` directly. (Warning: only working for terminal which is open after the path has added) – cpprust Sep 28 '22 at 14:28
  • I prefer `mingw-w64-x86_64-make` rather than `make` because mingw version is depend on windows library directly, it's faster. MSYS2 have many types of runtime and they are independent, check [msys2 environments](https://www.msys2.org/docs/environments/). The way MSYS2 organizes them is like dealing with different system, usually I'll choose one and stay. I really enjoy the convenience to install library or other program by command, e.g. install `gcc` with `pacman -Ss mingw-w64-x86_64-gcc`. Another benefit is you can upgrade everything in one command `pacman -Syu`. – cpprust Sep 28 '22 at 14:47