download the sources and build expdef.exe
i686-w64-mingw32-g++-win32 -static -m32 -Wall -O2 -o expdef.exe expdef.cpp
generate the .def and the libsomething.dll.a implib
wine ./expdef.exe -p -o something.dll >something.def
i686-w64-mingw32-dlltool --no-leading-underscore -d something.def -D something.dll -l libsomething.dll.a
if something.dll use stdcall
convention the sources need to prefix the prototype declarations with [[gnu::stdcal]]
[[gnu::stdcall]] void *SomeFunctionInSomething(void);
build and link the executable
i686-w64-mingw32-g++-win32 -Wall -O2 -I./include -o someprogram.exe someprogram.cpp -L. -lsomething
That’s it.