(SOLVED) Re: linking to shared lib on Windows

cartland example at example.com
Tue Nov 19 10:10:14 UTC 2019


On Wednesday, 13 November 2019 at 00:47:11 UTC, cartland wrote:
> I now have the following working on Linux and macOS.
> *snip*
>
> What is the approach on Windows these days (many posts on the 
> matter seem out of date)? The shared C dll was built in 
> MSYS2/MINGW32.
>
>*snip*

FYI
Got it working using the sdl below. libmylib.lib/dll is built 
using the msys2 mingw32 toolchain.

I have a cmd file which wraps dub:
rdub.cmd
----------
set DLANG_DUB_LIBS=..\..\_cache\libmylib
mkdir bin
copy "%DLANG_DUB_LIBS%.dll" bin
dub -a x86_mscoff %1 %2 %3 %4 %5
----------

dub.sdl
------------
name "myapp"
targetType "executable"
description "A minimal D application."
authors "bartland"
copyright "Copyright © 2019, bartland"
license "public"
libs "$DLANG_DUB_LIBS" platform="windows"
libs "mylib" platform="posix"
lflags "-L../../_cache/" "-rpath" "../../_cache/" platform="posix"

targetPath "bin"
-------------


More information about the Digitalmars-d-learn mailing list