Linux 为GNU无线电3.8编译gr gsm时出错
我正在尝试编译gr gsm()项目。运行cmake时,我发生以下错误:Linux 为GNU无线电3.8编译gr gsm时出错,linux,build,cmake,ld,Linux,Build,Cmake,Ld,我正在尝试编译gr gsm()项目。运行cmake时,我发生以下错误: . . . Building C object CMakeFiles/cmTC_5223d.dir/CheckFunctionExists.c.o /usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_5223d.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.16/Modul
.
.
.
Building C object CMakeFiles/cmTC_5223d.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_5223d.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.16/Modules/CheckFunctionExists.c
Linking C executable cmTC_5223d
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_5223d.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -rdynamic CMakeFiles/cmTC_5223d.dir /CheckFunctionExists.c.o -o cmTC_5223d -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_5223d.dir/build.make:87: cmTC_5223d] Błąd 1
make[1]: Opuszczenie katalogu '/home/notroot/Pobrane/gr-gsm/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_5223d/fast] Błąd 2
Building C object CMakeFiles/cmTC_5223d.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_5223d.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.16/Modules/CheckFunctionExists.c
Linking C executable cmTC_5223d
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_5223d.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -rdynamic CMakeFiles/cmTC_5223d.dir/CheckFunctionExists.c.o -o cmTC_5223d -lpthread
/usr/bin/ld: cannot find -lpthread
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_5223d.dir/build.make:87: cmTC_5223d] Błąd 1
make[1]: Opuszczenie katalogu '/home/notroot/Pobrane/gr-gsm/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_5223d/fast] Błąd 2
在运行/usr/bin/cc-lpthreads命令后,我也会出现以下错误:
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
但不是在运行生成此输出的/usr/bin/cc-lpthread命令之后:
/usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../lib/Scrt1.o: in function `_start':
(.text+0x24): undefined reference to `main'
collect2: error: ld returned 1 exit status
我设法用grep-irl“lpthreads”替换所有-lpthreads标志。运行后,我看到以下错误:
.
.
.
Building C object CMakeFiles/cmTC_5223d.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_5223d.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.16/Modules/CheckFunctionExists.c
Linking C executable cmTC_5223d
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_5223d.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -rdynamic CMakeFiles/cmTC_5223d.dir /CheckFunctionExists.c.o -o cmTC_5223d -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_5223d.dir/build.make:87: cmTC_5223d] Błąd 1
make[1]: Opuszczenie katalogu '/home/notroot/Pobrane/gr-gsm/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_5223d/fast] Błąd 2
Building C object CMakeFiles/cmTC_5223d.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_5223d.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.16/Modules/CheckFunctionExists.c
Linking C executable cmTC_5223d
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_5223d.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -rdynamic CMakeFiles/cmTC_5223d.dir/CheckFunctionExists.c.o -o cmTC_5223d -lpthread
/usr/bin/ld: cannot find -lpthread
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_5223d.dir/build.make:87: cmTC_5223d] Błąd 1
make[1]: Opuszczenie katalogu '/home/notroot/Pobrane/gr-gsm/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:121: cmTC_5223d/fast] Błąd 2
但是在没有cmake ld的情况下运行时,会发现一个lpthread 我找到了一个解决方案:
此代码不适用于GNU radio 3.8。仅适用于GNU radio 3.7。“在运行cmake时,我出现以下错误”-这不是阻止构建项目的错误。只需检查一下CMake,您的系统是否有
pthreads
库。然后它还会检查pthread
库。在所有检查之后,CMake决定哪个库可以用于POSIX线程功能。如果在构建项目时出现实际错误,请显示cmake
调用输出的适当部分。您显示的是cmakerorlog.txt
文件,如果没有cmake
的主要输出,查看此文件毫无意义。这是CMakeError.logfull日志的最后一部分-当运行cmake
时,您会收到如下消息:--配置不完整,出现错误!另请参见«/home/noroot/xcicoin/Pobrane/gr gsm/build/CMakeFiles/CMakeOutput.log»
,对吗?如果要处理此问题,首先需要查找实际错误消息,该消息位于--Configure complete
行上方的某个位置。如果不知道此错误消息,就没有理由查看CMakeOutput.log
和CMakeError.log
文件。请显示来自cmake
输出的实际错误消息。请注意,没有任何文件包含此消息。不,不要查看文件,请查看cmake
output。为什么您认为构建gr gsm
失败了?你为什么要查这些文件?你在哪里找到他们的名字?