Static link of glfw3 library fails for me

Mike Parker aldacron at gmail.com
Mon Jul 27 08:53:25 UTC 2020


On Monday, 27 July 2020 at 07:30:42 UTC, John Burton wrote:

> For reference I got this to work by doing the following :-
>
> 1) Installed visual studio build tools. I could not get this to 
> work at all with the linker etc that comes with ldc2.
> 2) Copied the glfw3.lib vs2019 version file into my build 
> directory (obviously could point the linker at it too which 
> would be better)
> 3) Used the following dub.sdl
>
> name "game"
> description "Test Project"
> authors "Me"
> copyright "Copyright ┬® 2020, Me"
> license "proprietary"
> dependency "bindbc-glfw" version="~>0.10.0"
> dflags "-mscrtlib=ucrt"
> libs "glfw3"
> versions "BindGLFW_Static"
>
> The key seems to be using the dflags line to make it link with 
> the "modern" C libraries, and using the microsoft linker.
>
> I appear to have glfw3 statically linked and working :)

Cool. To be clear, you're still compiling with LDC, correct? I'm 
pretty sure DMD is using the universal C runtime out of the box 
when VS is installed.


More information about the Digitalmars-d-learn mailing list