我正在尝试编译用于编译C项目库的shell脚本,但是在编译nmake部件时,我却陷入了困境。
我正在使用NDK 21,cmake版本是3.10
我正在使用与此处定义的bash相同的shell脚本,我想压缩此库,因为它们显示在运行./android.sh的文档中
请检查链接:https://github.com/tanersener/mobile-ffmpeg#52-build-scripts
这是随附的日志:
DEBUG: Downloading library source: cpu-features
DEBUG: Checking if cpu-features is already downloaded at /d/Bilals/Projects/GithubProjects/mobile-ffmpeg/src/cpu-features
INFO: cpu-features library already downloaded
INFO: cpu-features already downloaded. Source folder found at /d/Bilals/Projects/GithubProjects/mobile-ffmpeg/src/cpu-features
-- Building for: NMake Makefiles
-- Check for working C compiler: D:/Bilals/PcBackupData/sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe
CMake Error: Generator: execution of make failed. Make command was: "nmake" "/NOLOGO" "cmTC_adf3f\fast"
-- Check for working C compiler: D:/Bilals/PcBackupData/sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64/bin/clang.exe -- broken
CMake Error at D:/Bilals/PcBackupData/sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/CMakeTestCCompiler.cmake:52 (message):
The C compiler
"D:/Bilals/PcBackupData/sdk/ndk/21.3.6528147/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:/Bilals/Projects/GithubProjects/mobile-ffmpeg/android/build/cpu-features/arm/CMakeFiles/CMakeTmp
Run Build Command:"nmake" "/NOLOGO" "cmTC_adf3f\fast"
The system cannot find the file specified
Generator: execution of make failed. Make command was: "nmake" "/NOLOGO" "cmTC_adf3f\fast"
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:9 (project)
-- Configuring incomplete, errors occurred!
See also "D:/Bilals/Projects/GithubProjects/mobile-ffmpeg/android/build/cpu-features/arm/CMakeFiles/CMakeOutput.log".
See also "D:/Bilals/Projects/GithubProjects/mobile-ffmpeg/android/build/cpu-features/arm/CMakeFiles/CMakeError.log".
这是我的环境变量
答案 0 :(得分:0)
您应该使用unsigned mask(int a)
{
int bit;
if(!((unsigned)a ^ (unsigned)-1)) return -1;
for(bit = sizeof(a)*CHAR_BIT - 1; bit; bit--)
{
if(((unsigned)a & (1U << bit))) break;
}
return (1U << (bit + 1)) - 1;
}
void foo(int a)
{
printf("prints 1 when any bit of a number equals 0: %d\n", !!((a & mask(a)) ^ mask(a)));
}
int main(void)
{
foo(15);
}
,而不是Linux Make
。一般来说,即使我使用WSL(Ubuntu)bash运行这些脚本,也从未将它们调整为在cygwin或mingw shell的Windows上运行。