Thank you for that link, that was exactly what I needed.
I now have a 432-byte array (totally static for now) which should play a single note, but I'm currently struggling to get sound playback to work in my separate project. (Sound playback worked just fine from the command line with openmpt123.exe and libopenmpt_example_cxx.exe.)
I am trying to base playback off of this example for now:
https://github.com/OpenMPT/openmpt/blob/libopenmpt-0.6.3/examples/libopenmpt_example_cxx.cppIn order to accomplish this, these are the steps I have taken:
1. I cloned git tag "libopenmpt-0.6.3" of openmpt.
2. I opened ./build/vs2022win10/libopenmpt.sln in Visual Studio 2022 and built Debug|Win32 (my separate project is 32-bit).
3. I copied the resulting .lib files from ./build/lib/vs2022win10/x86/Debug/ into my separate project's lib include directory. (libopenmpt.lib, openmpt-ogg.lib, openmpt-portaudio.lib, openmpt-portaudiocpp.lib, openmpt-vorbis.lib, and openmpt-zlib.lib)
3a. I also had to copy over ./bin/debug/vs2022-win10-static/x86/openmpt-mpg123.lib to resolve some linker errors.
4. I copied the public interface headers from ./libopenmpt/ into my project's header include directory (just libopenmpt.hpp, libopenmpt_config.h, and libopenmpt_version.h).
5. I copied all header files from ./include/portaudio/include/ and ./include/portaudio/bindings/cpp/include/portaudiocpp/ into my project's header include directory.
Currently, I am facing 18 "unresolved external symbol" linker errors, all of which are being reported by openmpt-portaudio.lib(pa_win_wdmks.obj).
Each unresolved symbol is in the form "_KS*", like "_KSDATAFORMAT_SUBTYPE_PCM" for example.
Can you take a look at the steps I took and tell me if anything I did seems odd/incomplete/unnecessary/barking up the wrong tree?
Your advice is sincerely appreciated.
Edit: I have narrowed down the root of the linker errors to this line of code:
portaudio::AutoSystem portaudio_initializer;
(taken from ./examples/libopenmpt_example_cxx.cpp)
I also noticed that my executable still expects to find openmpt-mpg123.dll. How do I configure it to use openmpt-mpg123.lib so that I do not have to redistribute the dll along with my executable?
(Do I even really need mpg123 at all? I noticed that ./libopenmpt/dox/dependencies.md mentions that minimp3 can be used instead, which I noticed is used by libopenmpt-small, so I gave that a shot but it seemed like it was missing portaudio, so I got stuck there as well.)
Edit 2: I built portaudio from source (
https://github.com/PortAudio/portaudio/tree/v19.7.0) and simply added the resulting portaudio.lib to my project and that resolved the 18 linker errors that I mentioned above.
With portaudio taken care of, I was able to switch back to libopenmpt-small instead of libopenmpt. (Except, to keep using the c++ bindings for portaudio, I kept openmpt-portaudiocpp.lib.)
Now my IT module is playing in my custom project, from a single tiny executable with no dlls

(now to do it all over again on Linux, and then again on Mac...)
Sorry for all the rambling but I think my issues are 100% resolved. However, I'm still curious what you think about this "frankenstein" approach of mixing libopenmpt and libopenmpt-small.
Edit 3: I realized I can build portaudiocpp from portaudio's source without using openmpt-portaudiocpp. So I am no longer mixing libopenmpt and libopenmpt-small. I am solely using libopenmpt-small.
I also got everything compiling and (statically) linking on Linux

Just Mac to go... (Edit 4: Mac is done)