簡體   English   中英

使用 Cygwin 時出錯:“collect2:致命錯誤:ld 以信號 11 [分段錯誤] 終止”

[英]Error using Cygwin: “collect2: fatal error: ld terminated with signal 11 [Segmentation fault]”

我正在嘗試使用 cygwin 在 Windows 10 x64 系統上下載openslide (在 Windows 上本地構建)。 我之前遇到了一個與chk_fail相關的錯誤,並將構建文件中的-D_FORTIFY_SOURCE行設置為 0 而不是默認值 (2)。 你現在可能知道我真的不知道我在做什么。 但是我在下面收到了一個新錯誤,與我讀到的 memory 錯誤有關。 我嘗試刪除整個 package 文件夾,包括 makefile 和 object 文件,然后再次從 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)

我解決了這個問題。 首先,甚至不用費心使用 Cygwin 構建這個 package。 由於依賴性問題,它無法工作,並且 package 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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM