Small C wrapper in your DUB package?
cy via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sun May 8 12:23:38 PDT 2016
Well, just messing with it myself, the solution seems to be to
make a .a library, link with /lib/libc.a since unlike .o, .a
breaks shared linkage, and then refer to it in libs as
"$PACKAGE_DIR/libmywrapper.a"
...
"preBuildCommands": ["make -C $PACKAGE_DIR"],
"libs":
["$PACKAGE_DIR/libmymagick.a","ImageMagick","/lib/libc.a"]
...
basically.
Then it doesn't work, because when ImageMagick calls dlopen, dmd
somehow switches the string "RegisterGIFImage" with
"gif_LTX_RegisterGIFImage" in the resulting executable.
But the wrapper works fine at least.
More information about the Digitalmars-d-learn
mailing list