使用CMake创建项目时出错:
-- Could NOT find Threads (missing: Threads_FOUND)
错误日志显示CMake绊倒了一些真正平庸的东西:
/usr/bin/cc -std=c11 -D_GNU_SOURCE -Wall -Wextra -Wpointer-arith -Wundef -Wvla -Wwrite-strings -Werror -Wno-error=extra -Wno-error=deprecated-declarations -Wno-error=sign-compare -Wno-error=strict-aliasing -Wno-error=type-limits -Wno-unused-parameter -Wno-error=unused-variable -Wno-error=undef -Wno-error=uninitialized -Wlogical-op -Wno-error=maybe-uninitialized -Waggregate-return -Wnested-externs -Wold-style-definition -Wstrict-prototypes -march=native -o CMakeFiles/cmTryCompileExec2533162744.dir/CheckIncludeFiles.c.o -c /mnt/shared/fooproj/build/release/CMakeFiles/CMakeTmp/CheckIncludeFiles.c /mnt/shared/fooproj/build/release/CMakeFiles/CMakeTmp/CheckIncludeFiles.c:5:5: error: function declaration isn’t a prototype [-Werror=strict-prototypes] int main(){return 0;} ^ /mnt/shared/fooproj/build/release/CMakeFiles/CMakeTmp/CheckIncludeFiles.c: In function ‘main’: /mnt/shared/fooproj/build/release/CMakeFiles/CMakeTmp/CheckIncludeFiles.c:5:5: error: old-style function definition [-Werror=old-style-definition] cc1: all warnings being treated as errors [...] Source: /* */ #includeint main(){return 0;}
这真的应该没有理由让CMake认为Threads不存在.我该如何解决这个问题?