Skip to content

windows 10 wsl2 linux找不到brpc #10

Description

@dangolbeeker
确定 pthread_create 是否存在失败,输出如下:
更改目录:/home/sudosocourus/work/media-server/build/CMakeFiles/CMakeTmp

运行构建命令:"/usr/bin/make" "cmTC_d96c9/fast"
/usr/bin/make -f CMakeFiles/cmTC_d96c9.dir/build.make CMakeFiles/cmTC_d96c9.dir/build
make[1]: 进入目录'/home/sudosocourus/work/media-server/build/CMakeFiles/CMakeTmp'
构建 C 对象 CMakeFiles/cmTC_d96c9.dir/CheckSymbolExists.c.o
/usr/bin/cc -o CMakeFiles/cmTC_d96c9.dir/CheckSymbolExists.c.o -c /home/sudosocourus/work/media-server/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
链接 C 可执行文件 cmTC_d96c9
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_d96c9.dir/link.txt --verbose=1
/usr/bin/cc -rdynamic CMakeFiles/cmTC_d96c9.dir/CheckSymbolExists.c.o -o cmTC_d96c9
CMakeFiles/cmTC_d96c9.dir/CheckSymbolExists.c.o:在函数“main”中:
CheckSymbolExists.c:(.text+0x1b): 未定义对“pthread_create”的引用
collect2:错误:ld 返回 1 个退出状态
CMakeFiles/cmTC_d96c9.dir/build.make:97:目标“cmTC_d96c9”的配方失败
make[1]: *** [cmTC_d96c9] 错误 1
make[1]: 离开目录 '/home/sudosocourus/work/media-server/build/CMakeFiles/CMakeTmp'
Makefile:126: 目标“cmTC_d96c9/fast”的配方失败
制作:*** [cmTC_d96c9/fast] 错误 2

文件/home/sudosocourus/work/media-server/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <pthread.h>

int main(int argc, char** argv)
{
  (无效)argv;
#ifndef pthread_create
  返回 ((int*)(&pthread_create))[argc];
#别的
  (无效)argc;
  返回0;
#万一
}

确定 pthreads 中是否存在函数 pthread_create 失败,输出如下:
更改目录:/home/sudosocourus/work/media-server/build/CMakeFiles/CMakeTmp

运行构建命令:"/usr/bin/make" "cmTC_464c2/fast"
/usr/bin/make -f CMakeFiles/cmTC_464c2.dir/build.make CMakeFiles/cmTC_464c2.dir/build
make[1]: 进入目录'/home/sudosocourus/work/media-server/build/CMakeFiles/CMakeTmp'
构建 C 对象 CMakeFiles/cmTC_464c2.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_464c2.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.10/Modules/CheckFunctionExists.c
链接 C 可执行文件 cmTC_464c2
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_464c2.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -rdynamic CMakeFiles/cmTC_464c2.dir/CheckFunctionExists.c.o -o cmTC_464c2 -lpthreads
/usr/bin/ld: 找不到 -lpthreads
collect2:错误:ld 返回 1 个退出状态
CMakeFiles/cmTC_464c2.dir/build.make:97:目标“cmTC_464c2”的配方失败
make[1]: *** [cmTC_464c2] 错误 1
make[1]: 离开目录 '/home/sudosocourus/work/media-server/build/CMakeFiles/CMakeTmp'
Makefile:126: 目标“cmTC_464c2/fast”的配方失败
制作:*** [cmTC_464c2/fast] 错误 2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions