Compiling the C compiler identification source file "CMakeCCompilerId.c" failed
同时,控制台也报错:
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- The ASM compiler identification is unknown
-- Didn't find assembler
CMake Error at CMakeLists.txt:30 (project):
No CMAKE_C_COMPILER could be found.
Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.
CMake Error at CMakeLists.txt:30 (project):
No CMAKE_CXX_COMPILER could be found.
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
原因是没有找到编译器,
1.没有安装
2.可能路径写错了,或者版本不对。
ubuntu子系统访问windows系统是,盘符必须小写
没有找到ndk,ndk路径写错了
再Ubuntu子系统里面,区分大小写,Windows盘符必须小写,
比如D盘,子系统中是:
/mnt/d/
修改./bashrc文件,
export ANDROID_NDK=/mnt/d/soft/android-ndk-r23-linux/android-ndk-r23
windows解决方法:
1.
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build\vcvarsall.bat" x64
2.
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: CMAKE_C_COMPILER-NOTFOUND
Build flags:
Id flags: -c
The output was:
系统找不到指定的文件。
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: CMAKE_C_COMPILER-NOTFOUND
Build flags:
Id flags: -D__CLASSIC_C__
The output was:
系统找不到指定的文件。
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: CMAKE_C_COMPILER-NOTFOUND
Build flags:
Id flags: --target=arm-arm-none-eabi;-mcpu=cortex-m3
The output was:
系统找不到指定的文件。
Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: CMAKE_CXX_COMPILER-NOTFOUND
Build flags:
Id flags: --c++
The output was:
系统找不到指定的文件。