在手动构建[Qv2ray](https://qv2ray.net/hacking/manuallybuild.html)时发生错误(至于`Qv2ray`是什么东西,**你懂的**)
![2622db093234ed167cd7c46a17f8cdaf.png](https://ppmm.org/images/2020/08/03/2622db093234ed167cd7c46a17f8cdaf.png)
`CMakeError.log`
```cmake
Determining if the pthread_create exist failed with the following output:
Change Dir: /home/pi/Qv2ray/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_0c610/fast"
/usr/bin/make -f CMakeFiles/cmTC_0c610.dir/build.make CMakeFiles/cmTC_0c610.dir/build
make[1]: 进入目录“/home/pi/Qv2ray/build/CMakeFiles/CMakeTmp”
Building C object CMakeFiles/cmTC_0c610.dir/CheckSymbolExists.c.o
/usr/bin/cc -o CMakeFiles/cmTC_0c610.dir/CheckSymbolExists.c.o -c /home/pi/Qv2ray/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTC_0c610
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_0c610.dir/link.txt --verbose=1
/usr/bin/cc CMakeFiles/cmTC_0c610.dir/CheckSymbolExists.c.o -o cmTC_0c610
/usr/bin/ld: CMakeFiles/cmTC_0c610.dir/CheckSymbolExists.c.o: in function `main':
CheckSymbolExists.c:(.text+0x38): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_0c610.dir/build.make:87:cmTC_0c610] 错误 1
make[1]: 离开目录“/home/pi/Qv2ray/build/CMakeFiles/CMakeTmp”
make: *** [Makefile:121:cmTC_0c610/fast] 错误 2
File /home/pi/Qv2ray/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <pthread.h>
int main(int argc, char** argv)
{
(void)argv;
#ifndef pthread_create
return ((int*)(&pthread_create))[argc];
#else
(void)argc;
return 0;
#endif
}
Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/pi/Qv2ray/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_31926/fast"
/usr/bin/make -f CMakeFiles/cmTC_31926.dir/build.make CMakeFiles/cmTC_31926.dir/build
make[1]: 进入目录“/home/pi/Qv2ray/build/CMakeFiles/CMakeTmp”
Building C object CMakeFiles/cmTC_31926.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_31926.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.13/Modules/CheckFunctionExists.c
Linking C executable cmTC_31926
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_31926.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTC_31926.dir/CheckFunctionExists.c.o -o cmTC_31926 -lpthreads
/usr/bin/ld: 找不到 -lpthreads
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_31926.dir/build.make:87:cmTC_31926] 错误 1
make[1]: 离开目录“/home/pi/Qv2ray/build/CMakeFiles/CMakeTmp”
make: *** [Makefile:121:cmTC_31926/fast] 错误 2
Performing C SOURCE FILE Test UV_LINT_W4 failed with the following output:
Change Dir: /home/pi/Qv2ray/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_95cd6/fast"
/usr/bin/make -f CMakeFiles/cmTC_95cd6.dir/build.make CMakeFiles/cmTC_95cd6.dir/build
make[1]: Entering directory '/home/pi/Qv2ray/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_95cd6.dir/src.c.o
/usr/bin/cc -DUV_LINT_W4 /W4 -o CMakeFiles/cmTC_95cd6.dir/src.c.o -c /home/pi/Qv2ray/build/CMakeFiles/CMakeTmp/src.c
cc: error: /W4: No such file or directory
make[1]: *** [CMakeFiles/cmTC_95cd6.dir/build.make:66: CMakeFiles/cmTC_95cd6.dir/src.c.o] Error 1
make[1]: Leaving directory '/home/pi/Qv2ray/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_95cd6/fast] Error 2
Source file was:
int main(void) { return 0; }
Performing C SOURCE FILE Test UV_LINT_NO_UNUSED_PARAMETER_MSVC failed with the following output:
Change Dir: /home/pi/Qv2ray/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_6c0e8/fast"
/usr/bin/make -f CMakeFiles/cmTC_6c0e8.dir/build.make CMakeFiles/cmTC_6c0e8.dir/build
make[1]: Entering directory '/home/pi/Qv2ray/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_6c0e8.dir/src.c.o
/usr/bin/cc -DUV_LINT_NO_UNUSED_PARAMETER_MSVC /wd4100 -o CMakeFiles/cmTC_6c0e8.dir/src.c.o -c /home/pi/Qv2ray/build/CMakeFiles/CMakeTmp/src.c
cc: error: /wd4100: No such file or directory
make[1]: *** [CMakeFiles/cmTC_6c0e8.dir/build.make:66: CMakeFiles/cmTC_6c0e8.dir/src.c.o] Error 1
make[1]: Leaving directory '/home/pi/Qv2ray/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_6c0e8/fast] Error 2
Source file was:
int main(void) { return 0; }
Performing C SOURCE FILE Test UV_LINT_NO_CONDITIONAL_CONSTANT_MSVC failed with the following output:
Change Dir: /home/pi/Qv2ray/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_fb39d/fast"
/usr/bin/make -f CMakeFiles/cmTC_fb39d.dir/build.make CMakeFiles/cmTC_fb39d.dir/build
make[1]: Entering directory '/home/pi/Qv2ray/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_fb39d.dir/src.c.o
/usr/bin/cc -DUV_LINT_NO_CONDITIONAL_CONSTANT_MSVC /wd4127 -o CMakeFiles/cmTC_fb39d.dir/src.c.o -c /home/pi/Qv2ray/build/CMakeFiles/CMakeTmp/src.c
cc: error: /wd4127: No such file or directory
make[1]: *** [CMakeFiles/cmTC_fb39d.dir/build.make:66: CMakeFiles/cmTC_fb39d.dir/src.c.o] Error 1
make[1]: Leaving directory '/home/pi/Qv2ray/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_fb39d/fast] Error 2
Source file was:
int main(void) { return 0; }
Performing C SOURCE FILE Test UV_LINT_NO_NONSTANDARD_MSVC failed with the following output:
Change Dir: /home/pi/Qv2ray/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_874dd/fast"
/usr/bin/make -f CMakeFiles/cmTC_874dd.dir/build.make CMakeFiles/cmTC_874dd.dir/build
make[1]: Entering directory '/home/pi/Qv2ray/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_874dd.dir/src.c.o
/usr/bin/cc -DUV_LINT_NO_NONSTANDARD_MSVC /wd4201 -o CMakeFiles/cmTC_874dd.dir/src.c.o -c /home/pi/Qv2ray/build/CMakeFiles/CMakeTmp/src.c
cc: error: /wd4201: No such file or directory
make[1]: *** [CMakeFiles/cmTC_874dd.dir/build.make:66: CMakeFiles/cmTC_874dd.dir/src.c.o] Error 1
make[1]: Leaving directory '/home/pi/Qv2ray/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_874dd/fast] Error 2
Source file was:
int main(void) { return 0; }
Performing C SOURCE FILE Test UV_LINT_NO_NONSTANDARD_EMPTY_TU_MSVC failed with the following output:
Change Dir: /home/pi/Qv2ray/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_79e04/fast"
/usr/bin/make -f CMakeFiles/cmTC_79e04.dir/build.make CMakeFiles/cmTC_79e04.dir/build
make[1]: Entering directory '/home/pi/Qv2ray/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_79e04.dir/src.c.o
/usr/bin/cc -DUV_LINT_NO_NONSTANDARD_EMPTY_TU_MSVC /wd4206 -o CMakeFiles/cmTC_79e04.dir/src.c.o -c /home/pi/Qv2ray/build/CMakeFiles/CMakeTmp/src.c
cc: error: /wd4206: No such file or directory
make[1]: *** [CMakeFiles/cmTC_79e04.dir/build.make:66: CMakeFiles/cmTC_79e04.dir/src.c.o] Error 1
make[1]: Leaving directory '/home/pi/Qv2ray/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_79e04/fast] Error 2
Source file was:
int main(void) { return 0; }
Performing C SOURCE FILE Test UV_LINT_NO_NONSTANDARD_FILE_SCOPE_MSVC failed with the following output:
Change Dir: /home/pi/Qv2ray/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_82e69/fast"
/usr/bin/make -f CMakeFiles/cmTC_82e69.dir/build.make CMakeFiles/cmTC_82e69.dir/build
make[1]: Entering directory '/home/pi/Qv2ray/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_82e69.dir/src.c.o
/usr/bin/cc -DUV_LINT_NO_NONSTANDARD_FILE_SCOPE_MSVC /wd4210 -o CMakeFiles/cmTC_82e69.dir/src.c.o -c /home/pi/Qv2ray/build/CMakeFiles/CMakeTmp/src.c
cc: error: /wd4210: No such file or directory
make[1]: *** [CMakeFiles/cmTC_82e69.dir/build.make:66: CMakeFiles/cmTC_82e69.dir/src.c.o] Error 1
make[1]: Leaving directory '/home/pi/Qv2ray/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_82e69/fast] Error 2
Source file was:
int main(void) { return 0; }
Performing C SOURCE FILE Test UV_LINT_NO_NONSTANDARD_NONSTATIC_DLIMPORT_MSVC failed with the following output:
Change Dir: /home/pi/Qv2ray/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_db256/fast"
/usr/bin/make -f CMakeFiles/cmTC_db256.dir/build.make CMakeFiles/cmTC_db256.dir/build
make[1]: Entering directory '/home/pi/Qv2ray/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_db256.dir/src.c.o
/usr/bin/cc -DUV_LINT_NO_NONSTANDARD_NONSTATIC_DLIMPORT_MSVC /wd4232 -o CMakeFiles/cmTC_db256.dir/src.c.o -c /home/pi/Qv2ray/build/CMakeFiles/CMakeTmp/src.c
cc: error: /wd4232: No such file or directory
make[1]: *** [CMakeFiles/cmTC_db256.dir/build.make:66: CMakeFiles/cmTC_db256.dir/src.c.o] Error 1
make[1]: Leaving directory '/home/pi/Qv2ray/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_db256/fast] Error 2
Source file was:
int main(void) { return 0; }
Performing C SOURCE FILE Test UV_LINT_NO_HIDES_LOCAL failed with the following output:
Change Dir: /home/pi/Qv2ray/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_5e46b/fast"
/usr/bin/make -f CMakeFiles/cmTC_5e46b.dir/build.make CMakeFiles/cmTC_5e46b.dir/build
make[1]: Entering directory '/home/pi/Qv2ray/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_5e46b.dir/src.c.o
/usr/bin/cc -DUV_LINT_NO_HIDES_LOCAL /wd4456 -o CMakeFiles/cmTC_5e46b.dir/src.c.o -c /home/pi/Qv2ray/build/CMakeFiles/CMakeTmp/src.c
cc: error: /wd4456: No such file or directory
make[1]: *** [CMakeFiles/cmTC_5e46b.dir/build.make:66: CMakeFiles/cmTC_5e46b.dir/src.c.o] Error 1
make[1]: Leaving directory '/home/pi/Qv2ray/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_5e46b/fast] Error 2
Source file was:
int main(void) { return 0; }
Performing C SOURCE FILE Test UV_LINT_NO_HIDES_PARAM failed with the following output:
Change Dir: /home/pi/Qv2ray/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_df279/fast"
/usr/bin/make -f CMakeFiles/cmTC_df279.dir/build.make CMakeFiles/cmTC_df279.dir/build
make[1]: Entering directory '/home/pi/Qv2ray/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_df279.dir/src.c.o
/usr/bin/cc -DUV_LINT_NO_HIDES_PARAM /wd4457 -o CMakeFiles/cmTC_df279.dir/src.c.o -c /home/pi/Qv2ray/build/CMakeFiles/CMakeTmp/src.c
cc: error: /wd4457: No such file or directory
make[1]: *** [CMakeFiles/cmTC_df279.dir/build.make:66: CMakeFiles/cmTC_df279.dir/src.c.o] Error 1
make[1]: Leaving directory '/home/pi/Qv2ray/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_df279/fast] Error 2
Source file was:
int main(void) { return 0; }
Performing C SOURCE FILE Test UV_LINT_NO_HIDES_GLOBAL failed with the following output:
Change Dir: /home/pi/Qv2ray/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_55f3d/fast"
/usr/bin/make -f CMakeFiles/cmTC_55f3d.dir/build.make CMakeFiles/cmTC_55f3d.dir/build
make[1]: Entering directory '/home/pi/Qv2ray/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_55f3d.dir/src.c.o
/usr/bin/cc -DUV_LINT_NO_HIDES_GLOBAL /wd4459 -o CMakeFiles/cmTC_55f3d.dir/src.c.o -c /home/pi/Qv2ray/build/CMakeFiles/CMakeTmp/src.c
cc: error: /wd4459: No such file or directory
make[1]: *** [CMakeFiles/cmTC_55f3d.dir/build.make:66: CMakeFiles/cmTC_55f3d.dir/src.c.o] Error 1
make[1]: Leaving directory '/home/pi/Qv2ray/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_55f3d/fast] Error 2
Source file was:
int main(void) { return 0; }
Performing C SOURCE FILE Test UV_LINT_NO_CONDITIONAL_ASSIGNMENT_MSVC failed with the following output:
Change Dir: /home/pi/Qv2ray/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_fb3c8/fast"
/usr/bin/make -f CMakeFiles/cmTC_fb3c8.dir/build.make CMakeFiles/cmTC_fb3c8.dir/build
make[1]: Entering directory '/home/pi/Qv2ray/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_fb3c8.dir/src.c.o
/usr/bin/cc -DUV_LINT_NO_CONDITIONAL_ASSIGNMENT_MSVC /wd4706 -o CMakeFiles/cmTC_fb3c8.dir/src.c.o -c /home/pi/Qv2ray/build/CMakeFiles/CMakeTmp/src.c
cc: error: /wd4706: No such file or directory
make[1]: *** [CMakeFiles/cmTC_fb3c8.dir/build.make:66: CMakeFiles/cmTC_fb3c8.dir/src.c.o] Error 1
make[1]: Leaving directory '/home/pi/Qv2ray/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_fb3c8/fast] Error 2
Source file was:
int main(void) { return 0; }
Performing C SOURCE FILE Test UV_LINT_NO_UNSAFE_MSVC failed with the following output:
Change Dir: /home/pi/Qv2ray/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_bd009/fast"
/usr/bin/make -f CMakeFiles/cmTC_bd009.dir/build.make CMakeFiles/cmTC_bd009.dir/build
make[1]: Entering directory '/home/pi/Qv2ray/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_bd009.dir/src.c.o
/usr/bin/cc -DUV_LINT_NO_UNSAFE_MSVC /wd4996 -o CMakeFiles/cmTC_bd009.dir/src.c.o -c /home/pi/Qv2ray/build/CMakeFiles/CMakeTmp/src.c
cc: error: /wd4996: No such file or directory
make[1]: *** [CMakeFiles/cmTC_bd009.dir/build.make:66: CMakeFiles/cmTC_bd009.dir/src.c.o] Error 1
make[1]: Leaving directory '/home/pi/Qv2ray/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_bd009/fast] Error 2
Source file was:
int main(void) { return 0; }
```