Use bindbc-sdl statically

ichneumwn idonotenjoyemail at idonotenjoyemail.org
Sat Apr 24 18:55:33 UTC 2021


On Saturday, 24 April 2021 at 16:44:09 UTC, Ishax wrote:
>
> So I have the lib files. It's failing with only an exit code. 
> No window is appearing. It's using the same D code as with the 
> dynamic setup which I was able to produce a window with.
> ```sdl
> dependency "bindbc-sdl" version="~>0.1.0"
> versions "BindSDL_Static"
> subConfigurations "bindbc-sdl" "staticBC"
> libs "SDL2" "SDL2_image"
> ```

Hi, Linux programmer here who just went through the process of 
working with dll's and lib's on windows. In my current 
understanding, there are three ways of working with libraries:

1. Load DLL's at runtime (LoadLibrary and such)
2. Linking with DLL's at compile time. The compiler adds code to 
automatically load the DLL's when your program starts. You do 
this by linking against an *import library*. These have a *.lib* 
extension
3. Linking against *static libraries*. These have a *.lib* 
extension

Note that 2. & 3. are different things, but the files you need 
end in .lib in both cases. You'll have to check that your .lib 
files are actually static libraries, not import libraries.

I am not sure if linking to outside sources is appropriate, so I 
will just copy-paste from stackoverflow:


"Use the lib command. If it's static, lib will show you a pile of 
.obj files inside. Not so if it's am implib."

     lib /list foo.lib


More information about the Digitalmars-d-learn mailing list