GNU Radio 3.8编译gr-gsm时发生错误

问题描述 投票:0回答:1

我正在尝试编译gr-gsm(https://github.com/ptrkrysik/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

并且运行/ 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替换为-lpthread标志。 xargs sed -i's / lpthreads / lpthread / g'命令。运行后,我看到以下错误:

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!

linux build cmake ld
1个回答
0
投票

我找到了解决方案:https://github.com/ptrkrysik/gr-gsm/issues/487

此代码不适用于GNU radio 3.8。仅适用于GNU radio 3.7。

© www.soinside.com 2019 - 2024. All rights reserved.