CMAKE_MAKE_PROGRAM is not set

时间:2025-04-27 07:04:44

ndk编译mnn时,报错:

CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_ASM_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
make: *** No targets specified and no makefile found.  Stop.

原因:

没有找到ndk,ndk路径写错了

再Ubuntu子系统里面,区分大小写,Windows盘符必须小写,

比如D盘,子系统中是:

/mnt/d/

修改./bashrc文件,

export ANDROID_NDK=/mnt/d/soft/android-ndk-r23-linux/android-ndk-r23