DUB: How to link an external library on Windows 10?

Ki Rill rill.ki at yahoo.com
Fri Aug 27 14:35:37 UTC 2021


On Friday, 27 August 2021 at 13:54:18 UTC, Steven Schveighoffer 
wrote:
> In the end, I got it to build and run, but I'd highly recommend 
> just linking against the `raylibdll.lib` and using the dll.
>
> -Steve

Steve, thank you! I got it working with `raylibdll.lib`!

SOLUTION:
1. `dub init`

2. `dub add raylib-d`

3. download `raylib` pre-compiled 
[binaries](https://github.com/raysan5/raylib/releases) for 
Microsoft Visual Studio (msvs)

4. put `raylib.dll` and `raylibdll.lib` into your project's 
folder (into the same directory, where you have `dub.json`)

5. add `"libs":["raylibdll"]` section into dub.json

Compile and run. It should work.


More information about the Digitalmars-d-learn mailing list