Closed mdmaas closed 2 years ago
Thanks for the issue! It looks like the problem may just be that the variable Clib
doesn't include the extension, and that Libdl.dlopen
apparently auto-appends it when missing but StaticToold.dlopen
doesn't
You can add manually it with StaticTools.DLEXT
which is the equivalent of Libdl.dlext
(so, e.g., Clib * StaticTools.DLEXT
if Clib
is a StaticString or Clib * Libdl.dlext
else) but to match functionality of Libdl I might also be able to check and append automatically
Great, this is a minor issue indeed. Matching the API of Libdl
sounds like a reasonable idea.
I'm calling a C shared library, and I found that I can't use
StaticTools.dlopen
and have to rely onLibdl.dlopen
instead.I think the problem is that
StaticTools.dlopen
returnsPtr{StaticTools.DYLIB} @0x0000000000000000
.Subsequent call to
StaticTools.dlopen
returnsPtr{Nothing} @0x0000000000000000
.And eventually static compilation crashes.
Minimal example I could come up with: