Hi there,
I cloned https://git.sleeping.town/BindBC/bindbc-sdl.git to get the latest SDL bindings for D. In addition I cloned bindbc-loader and bindbc-common and copied the files into the appropriate directories. Then I cloned SDL and SDL_net and built everything in Release mode using Visual Studio 2022. So basically now my project contains the following files:
C:\Users\Acer\source\repos\adokhugi\game-d
26.03.2025 18:30 <DIR> .
26.03.2025 17:47 <DIR> ..
26.03.2025 18:25 <DIR> source
26.03.2025 17:50 138 .gitignore
26.03.2025 18:27 5,214 app.obj
26.03.2025 18:25 46 build.bat
26.03.2025 18:27 288 dub.sdl
26.03.2025 18:20 2,515,968 SDL3.dll
26.03.2025 18:20 272,158 SDL3.lib
26.03.2025 18:21 128,000 SDL3_net.dll
26.03.2025 18:21 9,676 SDL3_net.lib
The contents of dub.sdl:
name "game-d"
description "A game coded in D using SDL"
authors "Claus D. Volko"
copyright "Copyright © 2025, Claus D. Volko"
license "proprietary"
dependency "bindbc-sdl" version="~>2.1.0"
versions "SDL_3_4" "SDL_Net_3_0"
libs "SDL3" "SDL3_net"
subConfiguration "bindbc-sdl" "staticBC"
The preliminary contents of source\app.d:
import bindbc.sdl;
void main(){
SDL_Init(SDL_INIT_VIDEO);
//etc.
SDL_Quit();
}
So when I try to build this, I get:
C:\Users\Acer\source\repos\adokhugi\game-d>dmd source\app.d -L SDL3.lib -L SDL3_net.lib
app.obj : error LNK2001: unresolved external symbol _D6bindbc6common7codegen10EnumMember9__xtoHashFNbNeKxSQCaQBwQBsQBnZm
app.obj : error LNK2001: unresolved external symbol _D6bindbc6common7codegen10EnumMember11__xopEqualsMxFKxSQCbQBxQBtQBoZb
app.obj : error LNK2001: unresolved external symbol _D6bindbc6common7codegen6FnBind6__initZ
app.obj : error LNK2001: unresolved external symbol _D6bindbc6common7codegen6FnBind9__xtoHashFNbNeKxSQBvQBrQBnQBiZm
app.obj : error LNK2001: unresolved external symbol _D6bindbc6common7codegen6FnBind11__xopEqualsMxFKxSQBwQBsQBoQBjZb
app.obj : error LNK2001: unresolved external symbol _D6bindbc6common7codegen8EnumIden9__xtoHashFNbNeKxSQBxQBtQBpQBkZm
app.obj : error LNK2001: unresolved external symbol _D6bindbc6common7codegen8EnumIden11__xopEqualsMxFKxSQByQBuQBqQBlZb
app.exe : fatal error LNK1120: 7 unresolved externals
Error: linker exited with status 1120
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\bin\HostX64\x64\link.exe /NOLOGO "app.obj" /DEFAULTLIB:"SDL3.lib" /DEFAULTLIB:"SDL3_net.lib" /DEFAULTLIB:phobos64 /LIBPATH:"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\lib\x64" legacy_stdio_definitions.lib /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22621.0\ucrt\x64" /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\um\x64"
Could anybody please tell me what I have to do in order to get this to work?
Thank you very much in advance!
PS: I don't know how to use dub.