【问题标题】:Error using Cygwin: "collect2: fatal error: ld terminated with signal 11 [Segmentation fault]"使用 Cygwin 时出错:“collect2:致命错误:ld 以信号 11 [分段错误] 终止”
【发布时间】:2021-03-27 20:18:50
【问题描述】:

我正在尝试使用 cygwin 在 Windows 10 x64 系统上下载 openslide(在 Windows 上本地构建)。我之前遇到了与chk_fail 相关的错误,并将构建文件中-D_FORTIFY_SOURCE 的行设置为0 而不是默认值(2)。你现在可能知道我真的不知道我在做什么。但是我在下面收到了一个新错误,与我读过的内存错误有关。我尝试删除整个包文件夹,包括 makefile 和目标文件,然后再次从 Github 克隆并重建,但它没有用。谁能给我关于这里发生了什么以及如何解决它的指示?将不胜感激。

Scanning dependencies of target ziptool
[ 90%] Building C object src/CMakeFiles/ziptool.dir/ziptool.c.obj
[ 90%] Linking C executable ziptool.exe
collect2: fatal error: ld terminated with signal 11 [Segmentation fault], core dumped
compilation terminated.
make[2]: *** [src/CMakeFiles/ziptool.dir/build.make:109: src/ziptool.exe] Error 1
make[2]: *** Deleting file 'src/ziptool.exe'
make[1]: *** [CMakeFiles/Makefile2:442: src/CMakeFiles/ziptool.dir/all] Error 2
make: *** [Makefile:161: all] Error 2
Failed: make $parallel (line 417)

【问题讨论】:

    标签: c++ gcc makefile cygwin mingw-w64


    【解决方案1】:

    我解决了这个问题。首先,甚至不用费心使用 Cygwin 构建这个包。由于依赖问题,它不会工作,并且包 README 中没有版本控制的记录。

    对于像我一样遇到此问题的其他人,您可以在此处下载最新版本的代码:https://github.com/openslide/openslide-winbuild/releases 并选择最新版本。

    我首先 pip 安装了 openslide-python。然后我将 openslide-win64-20171122(来自 Github)移动到 anaconda3/site-packages(不是必需的,但很好),然后从 anaconda3/site-packages/openslide 我打开了 lowlevel.py。

    在lowlevel.py中,需要添加以下几行: (导入库后开始)

    os.environ['PATH'] = "path/to/openslide-win64-20171122/bin" + ";" + os.environ['PATH']
    

    你也可以改变这一行:

    if platform.system() == 'Windows':
        _lib = cdll.LoadLibrary('libopenslide-0.dll')
    

    到这里:

    if platform.system() == 'Windows':
        _lib = cdll.LoadLibrary(util.find_library("libopenslide-0.dll"))
    

    以便它搜索 libopenslide-0.dll 文件。然后别忘了在开头加上from ctypes import util

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-02-25
      • 2014-10-11
      • 1970-01-01
      • 1970-01-01
      • 2016-06-28
      • 1970-01-01
      • 2020-02-06
      相关资源
      最近更新 更多