英文:
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作为开发环境。按照以下步骤安装缺失的库:
-
在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位系统软件包。 -
通过运行
pacman -S libltdl
来安装该软件包。 -
通过运行
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.
-
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
.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论