Running 'nmake' '-?' failed with: The system cannot find the file specified

1.1k Views Asked by At

I am trying to run ./android.sh and command fails with below error on Git Bash. I am using windows 64 bit. I am following this

Building ffmpeg-kit library for Android

Architectures: arm-v7a, arm-v7a-neon, arm64-v8a, x86, x86-64
Libraries: none

Downloading sources: ok

Building arm-v7a platform on API level 24

cpu-features: failed

See build.log for details

When I check build.log it shows me this error

     Building for: NMake Makefiles
CMake Error at CMakeLists.txt:9 (project):
  Running

   'nmake' '-?'

  failed with:

   The system cannot find the file specified

Below are contents of cpu-features.sh

#!/bin/bash

$(android_ndk_cmake) -DBUILD_PIC=ON || return 1

make -C "$(get_cmake_build_directory)" || return 1

make -C "$(get_cmake_build_directory)" install || return 1

# CREATE PACKAGE CONFIG MANUALLY

create_cpufeatures_package_config "0.7.0" || return 1

and CMake is located at C:\Program Files\CMake\bin in my system which I have added in Environment variables too

If i am not wrong, nmake is tool included with visual studio and there is no mention of namke or visual studio in Prerequisties on github page. So why is command failing. What it actually requires here?

Detailed build logs:

INFO: Building cpu-features for arm-linux-androideabi with the following environment variables

ProgramFiles(x86)=C:\Program Files (x86)
!::=::\
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
SHELL=/usr/bin/bash
NUMBER_OF_PROCESSORS=8
FPS_BROWSER_USER_PROFILE_STRING=Default
GPL_ENABLED=no
PROCESSOR_LEVEL=6
TERM_PROGRAM_VERSION=3.6.3
MINGW_PREFIX=/mingw64
PKG_CONFIG_PATH=/mingw64/lib/pkgconfig:/mingw64/share/pkgconfig
USERDOMAIN_ROAMINGPROFILE=LAPTOP-41D6RA2U
HOSTNAME=LAPTOP-41D6RA2U
DETECTED_NDK_VERSION=25.2.9519653
PROGRAMFILES=C:\Program Files
MSYSTEM=MINGW64
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
ORIGINAL_TEMP=/tmp
MINGW_CHOST=x86_64-w64-mingw32
OS=Windows_NT
HOMEDRIVE=C:
INSTALL_PKG_CONFIG_DIR=/c/Users/bhuvn/StudioProjects/ffmpeg-kit/prebuilt/android-arm/pkgconfig
MSYSTEM_CARCH=x86_64
USERDOMAIN=LAPTOP-41D6RA2U
PWD=/c/Users/bhuvn/StudioProjects/ffmpeg-kit
USERPROFILE=C:\Users\bhuvn
OneDriveConsumer=C:\Users\bhuvn\OneDrive
MANPATH=/mingw64/local/man:/mingw64/share/man:/usr/local/man:/usr/share/man:/usr/man:/share/man
CXX=armv7a-linux-androideabi24-clang++
CXXFLAGS=-std=c++11 -fno-exceptions -fno-rtti -Os -ffunction-sections -fdata-sections
MINGW_PACKAGE_PREFIX=mingw-w64-x86_64
ALLUSERSPROFILE=C:\ProgramData
ORIGINAL_PATH=/mingw64/bin:/usr/bin:/c/Users/bhuvn/bin:/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/WINDOWS/System32/OpenSSH:/cmd:/c/CMake/bin:/c/Users/bhuvn/AppData/Local/Microsoft/WindowsApps
CommonProgramW6432=C:\Program Files\Common Files
TOOLCHAIN_ARCH=arm
LDFLAGS=-march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -Wl,--fix-cortex-a8 -Wl,--gc-sections,--icf=safe -Os -ffunction-sections -fdata-sections -lc -lm -ldl -llog -LC:\Users\bhuvn\AppData\Local\Android\Ndk\android-ndk-r25c/toolchains/llvm/prebuilt/cygwin-x86_64/arm-linux-androideabi/lib -LC:\Users\bhuvn\AppData\Local\Android\Ndk\android-ndk-r25c/toolchains/llvm/prebuilt/cygwin-x86_64/sysroot/usr/lib/arm-linux-androideabi/24 -LC:\Users\bhuvn\AppData\Local\Android\Ndk\android-ndk-r25c/toolchains/llvm/prebuilt/cygwin-x86_64/lib -Wl,--hash-style=both -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libunwind.a
HOME=/c/Users/bhuvn
USERNAME=bhuvn
SSH_ASKPASS=/mingw64/bin/git-askpass.exe
PLINK_PROTOCOL=ssh
OneDrive=C:\Users\bhuvn\OneDrive
COMSPEC=C:\WINDOWS\system32\cmd.exe
ZLIB_PACKAGE_CONFIG_PATH=/c/Users/bhuvn/StudioProjects/ffmpeg-kit/prebuilt/android-arm/pkgconfig/zlib.pc
TMPDIR=/tmp
FFMPEG_KIT_BUILD_TYPE=android
API=24
APPDATA=C:\Users\bhuvn\AppData\Roaming
LD=lld
SYSTEMROOT=C:\WINDOWS
LOCALAPPDATA=C:\Users\bhuvn\AppData\Local
PKG_CONFIG_LIBDIR=/c/Users/bhuvn/StudioProjects/ffmpeg-kit/prebuilt/android-arm/pkgconfig
COMPUTERNAME=LAPTOP-41D6RA2U
INFOPATH=/mingw64/local/info:/mingw64/share/info:/usr/local/info:/usr/share/info:/usr/info:/share/info
SED_INLINE=sed -i
TERM=xterm
TOOLCHAIN=cygwin-x86_64
LOGONSERVER=\\LAPTOP-41D6RA2U
ACLOCAL_PATH=/mingw64/share/aclocal:/usr/share/aclocal
PSModulePath=C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
LIB_INSTALL_BASE=/c/Users/bhuvn/StudioProjects/ffmpeg-kit/prebuilt/android-arm
AR=llvm-ar
AS=armv7a-linux-androideabi24-clang
ORIGINAL_API=24
ARCH=arm-v7a
TEMP=/tmp
MSYSTEM_CHOST=x86_64-w64-mingw32
DISPLAY=needs-to-be-defined
ORIGINAL_TMP=/tmp
SHLVL=3
NM=llvm-nm
PROCESSOR_REVISION=8e0c
DriverData=C:\Windows\System32\Drivers\DriverData
ANDROID_SDK_ROOT=C:\Users\bhuvn\AppData\Local\Android\Sdk
FFMPEG_KIT_TMPDIR=/c/Users/bhuvn/StudioProjects/ffmpeg-kit/.tmp
COMMONPROGRAMFILES=C:\Program Files\Common Files
LC_CTYPE=en_US.UTF-8
EXEPATH=C:\Program Files\Git
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 142 Stepping 12, GenuineIntel
SESSIONNAME=Console
BASEDIR=/c/Users/bhuvn/StudioProjects/ffmpeg-kit
ANDROID_NDK_ROOT=C:\Users\bhuvn\AppData\Local\Android\Ndk\android-ndk-r25c
PKG_CONFIG_SYSTEM_LIBRARY_PATH=/mingw64/lib
STRIP=llvm-strip
HOMEPATH=\Users\bhuvn
TMP=/tmp
CONFIG_SITE=/etc/config.site
PATH=/c/Users/bhuvn/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/Users/bhuvn/bin:/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/WINDOWS/System32/OpenSSH:/cmd:/c/CMake/bin:/c/Users/bhuvn/AppData/Local/Microsoft/WindowsApps:/usr/bin/vendor_perl:/usr/bin/core_perl:C:\Users\bhuvn\AppData\Local\Android\Ndk\android-ndk-r25c/toolchains/llvm/prebuilt/cygwin-x86_64/bin
ProgramW6432=C:\Program Files
CC=armv7a-linux-androideabi24-clang
MSYSTEM_PREFIX=/mingw64
CFLAGS=-march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -DFFMPEG_KIT_ARM_V7A -std=c99 -Wno-unused-function -fstrict-aliasing -DANDROID_NDK -fPIC -DANDROID -D__ANDROID__ -D__ANDROID_MIN_SDK_VERSION__=24 -Os -ffunction-sections -fdata-sections  
WINDIR=C:\WINDOWS
FPS_BROWSER_APP_PROFILE_STRING=Internet Explorer
PROCESSOR_ARCHITECTURE=AMD64
PUBLIC=C:\Users\Public
PKG_CONFIG_SYSTEM_INCLUDE_PATH=/mingw64/include
RANLIB=llvm-ranlib
SYSTEMDRIVE=C:
TERM_PROGRAM=mintty
ProgramData=C:\ProgramData
_=/usr/bin/env
----------------------------------------------------------------

INFO: System information

INFO: MINGW64_NT-10.0-22000 LAPTOP-41D6RA2U 3.3.6-bec3d608-341.x86_64 2023-02-22 08:29 UTC x86_64 Msys

----------------------------------------------------------------

-- Building for: NMake Makefiles
CMake Error at CMakeLists.txt:9 (project):
  Running

   'nmake' '-?'

  failed with:

   The system cannot find the file specified


-- Configuring incomplete, errors occurred!

Update 1 based on Answer I tried installing Microsoft Visual Studio 2022. In Visual Studio Installer I get variety of package to choose from. If I install everything it will consume huge space. I basically needs nmake. I installed visual studio core editor but it doesn't have nmake. Which package workload do I need to install exactly for nmake? Attached are screenshots

enter image description here

enter image description here

2

There are 2 best solutions below

0
On

in my case I got nmake.exe succesfully installed, after installing the Toolset called

C++ desktop developemnt
0
On

I think your build requires some kind of "make" tool and for some reason CMake fails to locate one. Most likely, GNU Make was supposed to be installed as part of dependencies for the packages listed in item 2.1.2. For some reason it wasn't installed, or CMake just fails to locate it, so CMake falls back to looking for alternative tool which is nmake which is another option on Windows.

I'm pretty sure the right direction for you is setting up proper environment with GNU toolchain and all the tools and not installing Visual Studio.