在Windows上使用Cygwin64构建hsdis-amd64.dll时未定义对dlopen,dlclose,dlsym和dlerror的引用

时间:2019-07-14 05:42:39

标签: java windows cygwin

使用来自“ https://dropzone.nfshost.com/hsdis/”的引用,我遇到了一个错误,即对'dlopen','dlclose','dlerror'和'dlsym'的未定义引用

app.181cb770.js

我发现可以在命令末尾添加参数“ -ldl”,例如

x86_64-w64-mingw32-gcc -o build/Linux-amd64/hsdis-amd64.dll -Ibuild/Linux-amd64/include -I/home/bahuwang/binutils-2.32/include -I/home/bahuwang/binutils-2.32/bfd -Ibuild/Linux-amd64/bfd -DLIBARCH_amd64 -DLIBARCH=\"amd64\" -DLIB_EXT=\".dll\" -O hsdis.c -shared build/Linux-amd64/bfd/libbfd.a build/Linux-amd64/opcodes/libopcodes.a build/Linux-amd64/libiberty/libiberty.a build/Linux-amd64/zlib/libz.a
build/Linux-amd64/bfd/libbfd.a(plugin.o):plugin.c:(.text+0x46c):undefined reference to 'dlopen'
build/Linux-amd64/bfd/libbfd.a(plugin.o):plugin.c:(.text+0x4a7):undefined reference to 'dlclose'
build/Linux-amd64/bfd/libbfd.a(plugin.o):plugin.c:(.text+0x543):undefined reference to 'dlerror'
build/Linux-amd64/bfd/libbfd.a(plugin.o):plugin.c:(.text+0x59c):undefined reference to 'dlsym'

但是已编译的hsdis-amd64.dll显示

x86_64-w64-mingw32-gcc -o build/Linux-amd64/hsdis-amd64.dll -Ibuild/Linux-amd64/include -I/home/bahuwang/binutils-2.32/include -I/home/bahuwang/binutils-2.32/bfd -Ibuild/Linux-amd64/bfd -DLIBARCH_amd64 -DLIBARCH=\"amd64\" -DLIB_EXT=\".dll\" -O hsdis.c -shared build/Linux-amd64/bfd/libbfd.a build/Linux-amd64/opcodes/libopcodes.a build/Linux-amd64/libiberty/libiberty.a build/Linux-amd64/zlib/libz.a -idl

出什么问题了?

当我使用命令在Centos 7上进行交叉编译时

Could not load hsdis-amd64.dll; library not loadable; PrintAssembly is disabled

效果很好。

0 个答案:

没有答案