代码之家  ›  专栏  ›  技术社区  ›  Percee

使用自定义python安装编译gdb 13.1找不到-lpython3.11

  •  0
  • Percee  · 技术社区  · 3 年前

    我在中安装了python PYTHON_DIR 。这是在Linux RHEL7上。

    ls $PYTHON_DIR
    bin include lib share
    ls $PYTHON_DIR/lib
    libpython3.11.so libpython3.11.so.1.0 libpython3.so pkgconfig python3.11
    

    我下载gdb13.1源代码,提取它,创建build-rhel7dir和cd。

    ../configure --with-python=$PYTHON_DIR
    make
    

    它失败了,说有 no usable python found at /path/to/python

    如果我打开 gdb/config.log 错误为:

    configure:22632: gcc -std=gnu99 -o conftest -g O2 -I/path/to/python/include -I/path/to/python/include/python3.11 -I/path/to/python/include/3.11 conftest.c -lpython3.11 -lpthread -ldl -lutil -lm -lncursesw -lm -ldl  >&5
    /usr/bin/ld: cannot find -lpython3.11
    

    所以问题是汇编不会调查 $PYTHON_DIR/lib 。即使我将此路径添加到 LD_LIBRARY_PATH ,它不会在那里查找,因此不会找到libpython3.11.so。

    如何在lib/目录中查找它?

    (我更改了路径,因为这是一个内部企业环境)。

    0 回复  |  直到 3 年前