# Make Error 127 \[Makefile:136: all\] Error 2

**URL:** https://discourse.cmake.org/t/make-error-127-makefile-all-error-2/9938
**Category:** Usage
**Tags:** os:windows, comp:mingw
**Created:** [January 25, 2024, 8:32pm UTC](https://discourse.cmake.org/t/make-error-127-makefile-all-error-2/9938 "2024-01-25T20:32:34Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Corruptsmurf](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/c/439d5e/32.png) [@Corruptsmurf](https://discourse.cmake.org/u/Corruptsmurf)
#### Post date: [January 25, 2024, 8:32pm UTC](https://discourse.cmake.org/t/make-error-127-makefile-all-error-2/9938/1 "2024-01-25T20:32:35Z")

</div>

Quick disclaimer: I am a novice. Feel free to explain things.

I am attempting to run these scripts to compile a custom build of ffmpeg:

> **[GitHub - dantmnf/AudioToolboxWrapper: enables FFmpeg to use AudioToolbox...](https://github.com/dantmnf/AudioToolboxWrapper)**
>
> enables FFmpeg to use AudioToolbox codecs on Windows - GitHub - dantmnf/AudioToolboxWrapper: enables FFmpeg to use AudioToolbox codecs on Windows

I originally had questions about this project that I posted on Stack Overflow (more details there):

> <https://stackoverflow.com/questions/77857027/mingw-64-cmake-error-cmake-will-not-be-able-to-correctly-generate-this-proje>

My OS is Windows 11 Pro 64-bit, Version 10.0.22621 Build 22621

To accomplish this, I did the following:

1. Installed MINGw64 and MINGw32
2. Ran some pacman commands to install various libraries (gcc, g++, cmake)
3. Placed the project in C:\01Code\ATW
4. Started running the commands listed on the github page.
5. Updated PATH environmental variable to include “C:\msys64\mingw64\bin”

Originally, I had a problem with cmake - it could not locate the compilers. I fixed this by editing the CMakeLists.txt file included with this project and setting explicit paths, then I had to change \ to / in the path and it worked.

The next step is to run “make install”, which looks like this:

> make install  
> _[25%] Building C object CMakeFiles/AudioToolboxWrapper.dir/src/AudioToolboxLoader.c.obj_  
> _[50%] Linking C static library libAudioToolboxWrapper.a_  
> _make[1]: /bin/sh: No such file or directory_  
> _make[1]: \*\*\* [CMakeFiles/Makefile2:86: CMakeFiles/AudioToolboxWrapper.dir/all] Error 127_  
> _make: \*\*\* [Makefile:136: all] Error 2_

I’ve looked through dozens of topics on here and StackOverflow about this and typically the advice is “edit your PATH variable” and the like. I’ve tried that, no luck.

I have several questions:

1. The error I was seeing with ‘cmake’ was similar to the one above - I was able to fix that by editing the CMakeLists.txt file. Is there a similar “instruction set” file for ‘make’?
2. Where can I find the logs or activity for ‘make’? When I was trying to debug the ‘cmake’ script, I opened “CMakeConfigureLog.yaml” to see the activity, output and specific errors that ‘cmake’ was throwing. I do not see a similar file anywhere for ‘make’.  
2a. I tried running the command ‘make install \> output.txt’ to address my second question (someone said this would produce output to debug ‘make’) but that just made a blank text document.

Please advise, happy to send whatever logs or syntax that would be helpful to you all - TIA.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [January 26, 2024, 2:13pm UTC](https://discourse.cmake.org/t/make-error-127-makefile-all-error-2/9938/2 "2024-01-26T14:13:32Z")

</div>

> [@Corruptsmurf](#):
>
> _make[1]: /bin/sh: No such file or directory_

It seems like your environment is not set up correctly. Can you run MinGW tooling (including `sh`) from where you ran `make`?

---

<div class="post-metadata">

### Author: ![Corruptsmurf](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/c/439d5e/32.png) [@Corruptsmurf](https://discourse.cmake.org/u/Corruptsmurf)
#### Post date: [January 26, 2024, 4:22pm UTC](https://discourse.cmake.org/t/make-error-127-makefile-all-error-2/9938/3 "2024-01-26T16:22:37Z")

</div>

> [@ben.boeckel](#):
>
> It seems like your environment is not set up correctly. Can you run MinGW tooling (including `sh`) from where you ran `make`?

I would be happy to! I just don’t know what “run MinGW tooling (including `sh`)” means.  
When I start MinGW, I `cd` to:  
` C:\01Code\ATW\build`  
That’s the directory I ran `make` from. Are you asking me to move the build to the directory where MinGW is installed? I’m open to any suggestions, I just want to understanding how to implement the advice.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [January 26, 2024, 5:37pm UTC](https://discourse.cmake.org/t/make-error-127-makefile-all-error-2/9938/4 "2024-01-26T17:37:42Z")

</div>

Hmm. Something seems weird here. MinGW is usually in an MSYS environment where paths look like `/c/01Code/ATW/build`

---

<div class="post-metadata">

### Author: ![Corruptsmurf](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/c/439d5e/32.png) [@Corruptsmurf](https://discourse.cmake.org/u/Corruptsmurf)
#### Post date: [January 26, 2024, 7:22pm UTC](https://discourse.cmake.org/t/make-error-127-makefile-all-error-2/9938/5 "2024-01-26T19:22:18Z")

</div>

Oh it does, sorry, I just copied and pasted the windows filepath where I put the build files.  
In MinGW, it looks like you have it above (screenshot below)

 ![mingw_ATW](https://discourse.cmake.org/uploads/default/original/2X/1/1acd84a60b659ba3c887dff85937a08c22aa983c.png)

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [January 26, 2024, 8:10pm UTC](https://discourse.cmake.org/t/make-error-127-makefile-all-error-2/9938/6 "2024-01-26T20:10:16Z")

</div>

Hmm. That is still odd. Can you do `make VERBOSE=1` to see the actual command that is failing?

---

<div class="post-metadata">

### Author: ![Corruptsmurf](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/c/439d5e/32.png) [@Corruptsmurf](https://discourse.cmake.org/u/Corruptsmurf)
#### Post date: [January 26, 2024, 10:23pm UTC](https://discourse.cmake.org/t/make-error-127-makefile-all-error-2/9938/7 "2024-01-26T22:23:43Z")

</div>

Oh nice, that sheds some more light on this. I bolded the section that looks like it gives the most information.  
EDIT: Including several blocks of output here.

**1. AFTER running** `make install` **once (and failing),** `make install VERBOSE=1` **gave the following output:**

> make install VERBOSE=1  
> C:/msys64/mingw64/bin/cmake.exe -SC:/01Code/ATW -BC:/01Code/ATW/build --check-build-system CMakeFiles/Makefile.cmake 0  
> C:/msys64/mingw64/bin/cmake.exe -E cmake\_progress\_start C:/01Code/ATW/build/CMakeFiles C:/01Code/ATW/build//CMakeFiles/progress.marks  
> C:/msys64/mingw64/bin/make -f CMakeFiles/Makefile2 all  
> make[1]: Entering directory ‘/c/01code/atw/build’  
> /mingw64/bin/make -f CMakeFiles/AudioToolboxWrapper.dir/build.make CMakeFiles/AudioToolboxWrapper.dir/depend  
> make[2]: Entering directory ‘C:/01code/atw/build’  
> **C:/msys64/mingw64/bin/cmake.exe -E cmake\_depends “Unix Makefiles” C:/01Code/ATW C:/01Code/ATW C:/01Code/ATW/build C:/01Code/ATW/build C:/01Code/ATW/build/CMakeFiles/AudioToolboxWrapper.dir/DependInfo.cmake “–color=”**  
> **Dependencies file “CMakeFiles/AudioToolboxWrapper.dir/src/AudioToolboxLoader.c.obj.d” is newer than depends file “C:/01Code/ATW/build/CMakeFiles/AudioToolboxWrapper.dir/compiler\_depend.internal”.**  
> **Consolidate compiler generated dependencies of target AudioToolboxWrapper**  
> make[2]: Leaving directory ‘C:/01code/atw/build’  
> /mingw64/bin/make -f CMakeFiles/AudioToolboxWrapper.dir/build.make CMakeFiles/AudioToolboxWrapper.dir/build  
> make[2]: Entering directory ‘C:/01code/atw/build’  
> make[2]: Nothing to be done for ‘CMakeFiles/AudioToolboxWrapper.dir/build’.  
> make[2]: Leaving directory ‘C:/01code/atw/build’  
> make[1]: /bin/sh: No such file or directory  
> make[1]: \*\*\* [CMakeFiles/Makefile2:86: CMakeFiles/AudioToolboxWrapper.dir/all] Error 127  
> make[1]: Leaving directory ‘/c/01code/atw/build’  
> make: \*\*\* [Makefile:136: all] Error 2

**2. Cleared out the build folder, ran cmake command again, then ran a “fresh”** `make install =VERBOSE` **, with the following output:**

> make install VERBOSE=1  
> C:/msys64/mingw64/bin/cmake.exe -SC:/01Code/ATW -BC:/01Code/ATW/build --check-build-system CMakeFiles/Makefile.cmake 0  
> C:/msys64/mingw64/bin/cmake.exe -E cmake\_progress\_start C:/01Code/ATW/build/CMakeFiles C:/01Code/ATW/build//CMakeFiles/progress.marks  
> C:/msys64/mingw64/bin/make -f CMakeFiles/Makefile2 all  
> make[1]: Entering directory ‘/c/01code/atw/build’  
> /mingw64/bin/make -f CMakeFiles/AudioToolboxWrapper.dir/build.make CMakeFiles/AudioToolboxWrapper.dir/depend  
> make[2]: Entering directory ‘C:/01code/atw/build’  
> C:/msys64/mingw64/bin/cmake.exe -E cmake\_depends “Unix Makefiles” C:/01Code/ATW C:/01Code/ATW C:/01Code/ATW/build C:/01Code/ATW/build C:/01Code/ATW/build/CMakeFiles/AudioToolboxWrapper.dir/DependInfo.cmake “–color=”  
> make[2]: Leaving directory ‘C:/01code/atw/build’  
> /mingw64/bin/make -f CMakeFiles/AudioToolboxWrapper.dir/build.make CMakeFiles/AudioToolboxWrapper.dir/build  
> make[2]: Entering directory ‘C:/01code/atw/build’  
> [25%] Building C object CMakeFiles/AudioToolboxWrapper.dir/src/AudioToolboxLoader.c.obj  
> C:/msys64/mingw64/bin/gcc.exe @CMakeFiles/AudioToolboxWrapper.dir/includes\_C.rsp -fno-ident -fno-unwind-tables -fno-asynchronous-unwind-tables -nostdlib -nostartfiles -nodefaultlibs -MD -MT CMakeFiles/AudioToolboxWrapper.dir/src/AudioToolboxLoader.c.obj -MF CMakeFiles/AudioToolboxWrapper.dir/src/AudioToolboxLoader.c.obj.d -o CMakeFiles/AudioToolboxWrapper.dir/src/AudioToolboxLoader.c.obj -c C:/01Code/ATW/src/AudioToolboxLoader.c  
> [50%] Linking C static library libAudioToolboxWrapper.a  
> C:/msys64/mingw64/bin/cmake.exe -P CMakeFiles/AudioToolboxWrapper.dir/cmake\_clean\_target.cmake  
> C:/msys64/mingw64/bin/cmake.exe -E cmake\_link\_script CMakeFiles/AudioToolboxWrapper.dir/link.txt --verbose=1  
> C:/msys64/mingw64/bin/ar.exe qc libAudioToolboxWrapper.a CMakeFiles/AudioToolboxWrapper.dir/src/AudioToolboxLoader.c.obj  
> C:/msys64/mingw64/bin/ranlib.exe libAudioToolboxWrapper.a  
> make[2]: Leaving directory ‘C:/01code/atw/build’  
> make[1]: /bin/sh: No such file or directory  
> make[1]: \*\*\* [CMakeFiles/Makefile2:86: CMakeFiles/AudioToolboxWrapper.dir/all] Error 127  
> make[1]: Leaving directory ‘/c/01code/atw/build’  
> make: \*\*\* [Makefile:136: all] Error 2

---

<div class="post-metadata">

### Author: ![Corruptsmurf](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/c/439d5e/32.png) [@Corruptsmurf](https://discourse.cmake.org/u/Corruptsmurf)
#### Post date: [January 26, 2024, 10:25pm UTC](https://discourse.cmake.org/t/make-error-127-makefile-all-error-2/9938/8 "2024-01-26T22:25:59Z")

</div>

Also I realize I just did `make install VERBOSE=1` instead of what you wrote.  
EDIT: Including several blocks of output here

**3. Cleared out build folder, re-ran cmake command, then a “fresh”** `make VERBOSE=1` **gave the following output:**

> make VERBOSE=1  
> C:/msys64/mingw64/bin/cmake.exe -SC:/01Code/ATW -BC:/01Code/ATW/build --check-build-system CMakeFiles/Makefile.cmake 0  
> C:/msys64/mingw64/bin/cmake.exe -E cmake\_progress\_start C:/01Code/ATW/build/CMakeFiles C:/01Code/ATW/build//CMakeFiles/progress.marks  
> C:/msys64/mingw64/bin/make -f CMakeFiles/Makefile2 all  
> make[1]: Entering directory ‘/c/01code/atw/build’  
> /mingw64/bin/make -f CMakeFiles/AudioToolboxWrapper.dir/build.make CMakeFiles/AudioToolboxWrapper.dir/depend  
> make[2]: Entering directory ‘C:/01code/atw/build’  
> C:/msys64/mingw64/bin/cmake.exe -E cmake\_depends “Unix Makefiles” C:/01Code/ATW C:/01Code/ATW C:/01Code/ATW/build C:/01Code/ATW/build C:/01Code/ATW/build/CMakeFiles/AudioToolboxWrapper.dir/DependInfo.cmake “–color=”  
> make[2]: Leaving directory ‘C:/01code/atw/build’  
> /mingw64/bin/make -f CMakeFiles/AudioToolboxWrapper.dir/build.make CMakeFiles/AudioToolboxWrapper.dir/build  
> make[2]: Entering directory ‘C:/01code/atw/build’  
> [25%] Building C object CMakeFiles/AudioToolboxWrapper.dir/src/AudioToolboxLoader.c.obj  
> C:/msys64/mingw64/bin/gcc.exe @CMakeFiles/AudioToolboxWrapper.dir/includes\_C.rsp -fno-ident -fno-unwind-tables -fno-asynchronous-unwind-tables -nostdlib -nostartfiles -nodefaultlibs -MD -MT CMakeFiles/AudioToolboxWrapper.dir/src/AudioToolboxLoader.c.obj -MF CMakeFiles/AudioToolboxWrapper.dir/src/AudioToolboxLoader.c.obj.d -o CMakeFiles/AudioToolboxWrapper.dir/src/AudioToolboxLoader.c.obj -c C:/01Code/ATW/src/AudioToolboxLoader.c  
> [50%] Linking C static library libAudioToolboxWrapper.a  
> C:/msys64/mingw64/bin/cmake.exe -P CMakeFiles/AudioToolboxWrapper.dir/cmake\_clean\_target.cmake  
> C:/msys64/mingw64/bin/cmake.exe -E cmake\_link\_script CMakeFiles/AudioToolboxWrapper.dir/link.txt --verbose=1  
> C:/msys64/mingw64/bin/ar.exe qc libAudioToolboxWrapper.a CMakeFiles/AudioToolboxWrapper.dir/src/AudioToolboxLoader.c.obj  
> C:/msys64/mingw64/bin/ranlib.exe libAudioToolboxWrapper.a  
> make[2]: Leaving directory ‘C:/01code/atw/build’  
> make[1]: /bin/sh: No such file or directory  
> make[1]: \*\*\* [CMakeFiles/Makefile2:86: CMakeFiles/AudioToolboxWrapper.dir/all] Error 127  
> make[1]: Leaving directory ‘/c/01code/atw/build’  
> make: \*\*\* [Makefile:136: all] Error 2

**4. Here is output for** `make VERBOSE=1` **AFTER a previous run of** `make install` **had already failed:**

> make VERBOSE=1  
> C:/msys64/mingw64/bin/cmake.exe -SC:/01Code/ATW -BC:/01Code/ATW/build --check-build-system CMakeFiles/Makefile.cmake 0  
> C:/msys64/mingw64/bin/cmake.exe -E cmake\_progress\_start C:/01Code/ATW/build/CMakeFiles C:/01Code/ATW/build//CMakeFiles/progress.marks  
> C:/msys64/mingw64/bin/make -f CMakeFiles/Makefile2 all  
> make[1]: Entering directory ‘/c/01code/atw/build’  
> /mingw64/bin/make -f CMakeFiles/AudioToolboxWrapper.dir/build.make CMakeFiles/AudioToolboxWrapper.dir/depend  
> make[2]: Entering directory ‘C:/01code/atw/build’  
> C:/msys64/mingw64/bin/cmake.exe -E cmake\_depends “Unix Makefiles” C:/01Code/ATW C:/01Code/ATW C:/01Code/ATW/build C:/01Code/ATW/build C:/01Code/ATW/build/CMakeFiles/AudioToolboxWrapper.dir/DependInfo.cmake “–color=”  
> make[2]: Leaving directory ‘C:/01code/atw/build’  
> /mingw64/bin/make -f CMakeFiles/AudioToolboxWrapper.dir/build.make CMakeFiles/AudioToolboxWrapper.dir/build  
> make[2]: Entering directory ‘C:/01code/atw/build’  
> make[2]: Nothing to be done for ‘CMakeFiles/AudioToolboxWrapper.dir/build’.  
> make[2]: Leaving directory ‘C:/01code/atw/build’  
> make[1]: /bin/sh: No such file or directory  
> make[1]: \*\*\* [CMakeFiles/Makefile2:86: CMakeFiles/AudioToolboxWrapper.dir/all] Error 127  
> make[1]: Leaving directory ‘/c/01code/atw/build’  
> make: \*\*\* [Makefile:136: all] Error 2

---

<div class="post-metadata">

### Author: ![Corruptsmurf](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/c/439d5e/32.png) [@Corruptsmurf](https://discourse.cmake.org/u/Corruptsmurf)
#### Post date: [January 26, 2024, 10:49pm UTC](https://discourse.cmake.org/t/make-error-127-makefile-all-error-2/9938/9 "2024-01-26T22:49:49Z")

</div>

Also, here is the text of the Makefile2 referenced in Error 127. It looks like line 86 of this is causing the error?

> **[2024.01.26 MakeFile2\_Audio Toolbox Wrapper](https://docs.google.com/document/d/1_Sntb9OyYVmm7A_gC3vO7k0RdbtW8mt4JZw76TnYLlI/edit?usp=sharing)**
>
> This Doc is private

---

<div class="post-metadata">

### Author: ![Corruptsmurf](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/c/439d5e/32.png) [@Corruptsmurf](https://discourse.cmake.org/u/Corruptsmurf)
#### Post date: [January 27, 2024, 7:35pm UTC](https://discourse.cmake.org/t/make-error-127-makefile-all-error-2/9938/10 "2024-01-27T19:35:58Z")

</div>

Okay, I got it to run. I’m not sure which of these things did the trick, but here is what I did:

1. Uninstalled MSYS2 entirely, rebooted.
2. Reinstalled MSYS2, rebooted.
3. Opened MINGW64, ran the following commands:  
`pacman -Suy`  
`pacman -Suy` (again x2)  
`pacman -S mingw-w64-x86_64-gcc`  
`pacman -S mingw-w64-x86_64-cmake`  
`pacman -S make`  
`pacman -Suy`
4. Closed MINGW64, updated system environmental variable PATH to include the following directories:  
o C:\msys64\mingw64\bin\ (this was already there, just being thorough)  
o C:\msys64\mingw64\lib\   
o C:\msys64\mingw64\
5. Opened MING64, ran the scripts again, everything went through this time.
