Home > Enterprise >  How to compile this dll using SDL with MinGW?
How to compile this dll using SDL with MinGW?

Time:01-02

Okay so I have been working on this fork for over a year now and this thing doesn't want to compile as dll on x86-64 mingw running on Windows 10. I am following the original instructions: https://github.com/kometbomb/klystron/wiki/libksnd#compiling-the-library

And this is what it tells (there are other errors which can be fixed but this infuriates me the most):

Building ksndstatic.lib...
make: lib: No such file or directory
make: [Makefile:117: bin.release/libksndstatic.a] Error 127 (ignored)
Linking ksnd.dll...
Building ksnd.lib...
make: lib: No such file or directory
make: [Makefile:127: bin.release/ksnd.dll] Error 127 (ignored)

What the hell is lib?! Is this Visual Studio thing or outdated name for dlltool or libtool? What kind of zombie toolchain is this even made for? (hint: year 2007 or even earlier)

This can be relatively easy compiled as a submodule using the same windows mingw toolchain: https://github.com/kometbomb/klystrack Or, if this does not work, try my fork: https://github.com/ltva1/klystrack

So the question is how to compile it at least with SDL linkage? Maybe I will be able to get it to work with native OSes APIs but at least I want a dll I can use in other C/C project.

CodePudding user response:

Okay, the static linking works at least. There are some problems with audio buffer but this is outside of this question scope. I followed the advices in the thread above: undefined COMSPEC and added linkage to winmm in the case COMSPEC is not defined. See makefile changes there: https://github.com/LTVA1/klystron/commit/47e4c31c86833ce8d879d4474ba4045e95ea1a22 (COMSPEC undefine thing is commented out so main project which uses the repo as submodule gets compiled; -lwsock32 thing is unneded actually). At least I get the sound from the thing. Will wait 2 days to accept as answer.

  • Related