nihui / ncnn-android-styletransfer

The style transfer android example
90 stars 20 forks source link

Sync CMake Error提示The C compiler #8

Closed cuihua0 closed 2 years ago

cuihua0 commented 2 years ago

CMake Warning at D:/androidsdk/ndk/23.1.7779620/build/cmake/android-legacy.toolchain.cmake:416 (message): An old version of CMake is being used that cannot automatically detect compiler attributes. Compiler identification is being bypassed. Some values may be wrong or missing. Update to CMake 3.19 or newer to use CMake's built-in compiler identification. Call Stack (most recent call first): D:/androidsdk/ndk/23.1.7779620/build/cmake/android.toolchain.cmake:55 (include) D:/androidsdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/CMakeDetermineSystem.cmake:94 (include) CMakeLists.txt:1 (project)

CMake Warning at D:/androidsdk/ndk/23.1.7779620/build/cmake/android-legacy.toolchain.cmake:416 (message): An old version of CMake is being used that cannot automatically detect compiler attributes. Compiler identification is being bypassed. Some values may be wrong or missing. Update to CMake 3.19 or newer to use CMake's built-in compiler identification. Call Stack (most recent call first): D:/androidsdk/ndk/23.1.7779620/build/cmake/android.toolchain.cmake:55 (include) D:/androidsdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/CMakeDetermineSystem.cmake:94 (include) CMakeLists.txt:1 (project)

CMake Warning at D:/androidsdk/ndk/23.1.7779620/build/cmake/android-legacy.toolchain.cmake:416 (message): An old version of CMake is being used that cannot automatically detect compiler attributes. Compiler identification is being bypassed. Some values may be wrong or missing. Update to CMake 3.19 or newer to use CMake's built-in compiler identification. Call Stack (most recent call first): D:/androidsdk/ndk/23.1.7779620/build/cmake/android.toolchain.cmake:55 (include) D:/ncnn-android-styletransfer-master/app/.cxx/cmake/debug/arm64-v8a/CMakeFiles/3.10.2/CMakeSystem.cmake:6 (include) D:/ncnn-android-styletransfer-master/app/.cxx/cmake/debug/arm64-v8a/CMakeFiles/CMakeTmp/CMakeLists.txt:2 (project)

CMake Warning at D:/androidsdk/ndk/23.1.7779620/build/cmake/android-legacy.toolchain.cmake:416 (message): An old version of CMake is being used that cannot automatically detect compiler attributes. Compiler identification is being bypassed. Some values may be wrong or missing. Update to CMake 3.19 or newer to use CMake's built-in compiler identification. Call Stack (most recent call first): D:/androidsdk/ndk/23.1.7779620/build/cmake/android.toolchain.cmake:55 (include) D:/ncnn-android-styletransfer-master/app/.cxx/cmake/debug/arm64-v8a/CMakeFiles/3.10.2/CMakeSystem.cmake:6 (include) D:/ncnn-android-styletransfer-master/app/.cxx/cmake/debug/arm64-v8a/CMakeFiles/CMakeTmp/CMakeLists.txt:2 (project)

CMake Error at D:/androidsdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/CMakeTestCCompiler.cmake:52 (message): The C compiler

"D:/androidsdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: D:/ncnn-android-styletransfer-master/app/.cxx/cmake/debug/arm64-v8a/CMakeFiles/CMakeTmp

Run Build Command:"D:\androidsdk\cmake\3.10.2.4988404\bin\ninja.exe" "cmTC_d4c19"
[1/2] Building C object CMakeFiles/cmTC_d4c19.dir/testCCompiler.c.o
[2/2] Linking C executable cmTC_d4c19
FAILED: cmTC_d4c19 
cmd.exe /C "cd . && D:\androidsdk\ndk\23.1.7779620\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe --target=aarch64-none-linux-android24 --gcc-toolchain=D:/androidsdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64 --sysroot=D:/androidsdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64/sysroot -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security  -static-libstdc++ -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -Wl,--gc-sections CMakeFiles/cmTC_d4c19.dir/testCCompiler.c.o  -o cmTC_d4c19  -latomic -lm && cd ."
ld: error: failed to write to the output file: Permission denied
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:1 (project)

CMake Error at D:/androidsdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/CMakeTestCCompiler.cmake:52 (message): The C compiler

"D:/androidsdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: D:/ncnn-android-styletransfer-master/app/.cxx/cmake/debug/arm64-v8a/CMakeFiles/CMakeTmp

Run Build Command:"D:\androidsdk\cmake\3.10.2.4988404\bin\ninja.exe" "cmTC_d4c19"
[1/2] Building C object CMakeFiles/cmTC_d4c19.dir/testCCompiler.c.o
[2/2] Linking C executable cmTC_d4c19
FAILED: cmTC_d4c19 
cmd.exe /C "cd . && D:\androidsdk\ndk\23.1.7779620\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe --target=aarch64-none-linux-android24 --gcc-toolchain=D:/androidsdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64 --sysroot=D:/androidsdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/windows-x86_64/sysroot -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security  -static-libstdc++ -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -Wl,--gc-sections CMakeFiles/cmTC_d4c19.dir/testCCompiler.c.o  -o cmTC_d4c19  -latomic -lm && cd ."
ld: error: failed to write to the output file: Permission denied
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:1 (project)

Configuration failed. executing external native build for cmake D:\ncnn-android-styletransfer-master\app\src\main\jni\CMakeLists.txt

FAILURE: Build failed with an exception.

CONFIGURE FAILED in 1s

CMake Error at D:/androidsdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/CMakeTestCCompiler.cmake:52 (message): The C compiler

cuihua0 commented 2 years ago

请大佬帮我看看吧。

cuihua0 commented 2 years ago

解决了