【问题标题】:poco netssl dll dependenciespoco netssl dll依赖
【发布时间】:2015-11-15 05:25:17
【问题描述】:

我正在构建一个 dll 以使用 PocoNetSSL 通过 HTTPS 端点获取一些数据。我需要在运行旧版本 Mono 的 Unity 中通过 C# 调用该 dll。

我正在使用 mingw-w64 shell 来构建我的 dll。通过包管理器 pacman 提供了一个 Poco 库包,我正在使用它。

$ pacman -Qs 'poco'
local/mingw-w64-x86_64-poco 1.6.0-2
    POrtable COmponents C++ Libraries (mingw-w64)

我可以构建一个可执行文件,它构建良好并且运行良好,可以访问 https 端点。我在某处安装了 openssl,或者它可能随 mingw 一起提供。

我的问题是我无法使用 LoadLibrary 打开 dll。我得到一个空指针,我猜这是一个依赖问题。这是我的构建命令和依赖walker 的快照。有什么我在这里想念的吗。我想我应该能够做到这一点,但也许不能?

sburke@sburke-pc MINGW64 ~/sandbox/hitaws
$ scons
scons: Reading SConscript files ...
msys
scons: done reading SConscript files.
scons: Building targets ...
g++ -o gdoaws.os -c -Wall -DPOCO_WIN32_UTF8 -I/mingw64/include gdoaws.cpp
g++ -o gdoaws.dll -Wl,-no-undefined -shared -Wl,--out-implib=libgdoaws.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive gdoaws.os -Wl,--no-whole-archive -L/mingw64/lib -lPocoNetSSL.dll -lPocoNet.dll -lPocoUtil.dll -lPocoFoundation.dll
scons: done building targets.

【问题讨论】:

    标签: dll mono dllimport poco-libraries msys2


    【解决方案1】:

    假设您加载的动态库代码是正确的,您的应用很可能会尝试加载与构建 Poco 不同版本的 openssl dll。

    msys2 中,您可以通过以下方式检查动态库依赖项:

    ldd /mingw64/bin/libPocoNetSSL.dll

    这取决于:

    LIBEAY32.dll => /mingw64/bin/LIBEAY32.dll 
    SSLEAY32.dll => /mingw64/bin/SSLEAY32.dll
    

    这就是你在dependency walker中看到的吗?

    解决此问题的最佳解决方法是将上述 dll 复制到可执行文件所在的文件夹,并始终将它们与您的软件一起分发。

    【讨论】:

      猜你喜欢
      • 2013-07-25
      • 1970-01-01
      • 2020-08-30
      • 1970-01-01
      • 2016-10-12
      • 2011-10-17
      • 1970-01-01
      • 2023-03-17
      • 1970-01-01
      相关资源
      最近更新 更多