Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 为GNU无线电3.8编译gr gsm时出错_Linux_Build_Cmake_Ld - Fatal编程技术网

Linux 为GNU无线电3.8编译gr gsm时出错

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

我正在尝试编译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/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
失败了?你为什么要查这些文件?你在哪里找到他们的名字?