Fabric-sdk-go ‘ld.exe: cannot find -lltdl’ 错误。

huangapple go评论91阅读模式
英文:

Fabric-sdk-go 'ld.exe: cannot find -lltdl' error

问题

当我尝试获取fabric-sdk-go时,出现以下错误:

$ go get github.com/hyperledger/fabric-sdk-go/pkg/fabric-client

github.com/hyperledger/fabric-sdk-go/vendor/github.com/miekg/pkcs11

C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: 无法找到 -lltdl
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: 无法找到 -lltdl
collect2.exe: 错误: ld 返回了 1 个退出状态

有人知道问题是什么以及如何解决吗?

英文:

When I try to get the fabric-sdk-go I get the following error:

$ go get github.com/hyperledger/fabric-sdk-go/pkg/fabric-client
# github.com/hyperledger/fabric-sdk-go/vendor/github.com/miekg/pkcs11
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lltdl
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lltdl
collect2.exe: error: ld returned 1 exit status

Does anyone have an idea what is the issue and how to resolve this?

答案1

得分: 1

错误消息告诉我们,github.com/miekg/pkcs11所需的库libltdl丢失了。虽然你没有明确提到,但我认为你正在使用MSYS2作为开发环境。按照以下步骤安装缺失的库:

  1. 在MSYS2终端中搜索缺失的库,输入pacman -Ss ltdl以获取确切的软件包名称。在这里,ltdl是与缺失库相关的关键字,我们从错误消息中得到的。你应该会得到类似于以下内容:

    msys/libltdl 2.4.6-2  
        A system independent dlopen wrapper for GNU libtool
    

    从结果中我们知道,缺失的库在libltdl软件包中提供。这似乎是微不足道的,但有时一个库可能由多个软件包提供,例如一个带有前缀mingw-w64-i686-*的32位系统软件包和一个带有前缀mingw-w64-x86_64-*的64位系统软件包。

  2. 通过运行pacman -S libltdl来安装该软件包。

  3. 通过运行go get -v github.com/hyperledger/fabric-sdk-go/pkg/fabric-client来重新安装go软件包。

英文:

The error message told us that the library libltdl which is required by github.com/miekg/pkcs11 is missing. Although you didn't mention it explicitly, I think you're using MSYS2 as the development environment. Do the following steps to install the missing library.

  1. Search for the missing library, type pacman -Ss ltdl in MSYS2 terminal to get the exact package name. Here, ltdl is the keyword related to missing library which we got from error message. You should get something like:

    <!-- language: lang-none -->

    msys/libltdl 2.4.6-2  
        A system independent dlopen wrapper for GNU libtool
    

From the result we know that the missing library is provided in libltdl package. It seems trivial, but sometimes a library may be provided by more than one package, e.g. a package which has prefix mingw-w64-i686-* for 32-bit system and the other with prefix mingw-w64-x86_64-* for 64-bit system.
2. Install the package by: pacman -S libltdl.
3. Reinstall the go package by: go get -v github.com/hyperledger/fabric-sdk-go/pkg/fabric-client.

huangapple
  • 本文由 发表于 2017年7月22日 15:33:49
  • 转载请务必保留本文链接:https://go.coder-hub.com/45251976.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定