我正在构建一个 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.