Integration into a C++ project in Qt

51 views
Skip to first unread message

Tamas Solymos

unread,
Apr 28, 2023, 6:59:58 AM4/28/23
to SoLoud audio engine
Hey,

I really like the idea behind this framework, and I'd like to use it in my Qt game dev project. I already have SDL2 setup and integrated, so that would be my preferred backend. I added SoLoud as a submodule in my (private) repo, and I changed Qt project files to set it up using sources. My problem is the lack of clear documentation (or the lack of my understanding thererof) about what to include in my project exactly.

Here's what I did:
  • I added "soloud/include" to my gcc include path
  • I added some "soloud/src" subfolders as sources and headers to my compilation list. I tried adding all subfolders, but I got a lot of errors, and some of them look like separate entities after a closer inspection. Currently, I am trying to build "audiosource", "backend", and "core", with the exclusion of "backend/vita_homebrew" because that tries to inclue psp source I don't have.
  • I defined WITH_SDL, and added the engine's init to my main (after SDL init) to test compilation.
This almost builds but I get "undefined reference to symbol" errors from C++ soloud sources including C soloud sources without "extern C". This looks like a bug in the soloud codebase, but I don't see people complaining about it, so I am not sure what I am missing here. My next try would be to either get GENie, build soloud, and then include the built object in my project, OR adding extern C to all places which I suspect to be broken in the C++ soloud includes.

Please help me on how to proceed with the setup. Much appreciated!

Tamas Solymos

unread,
Apr 29, 2023, 2:09:02 PM4/29/23
to SoLoud audio engine
To anyone reading this with the same problem:
  1. I found it impossible to include and link soloud sources into a project, unless you already each of their purposes and inter-connectivity. 
  2. I also found the GENie-based build folder broken: after generating cmake project with GENie, make did nothing. I think some rules are missing, even though I followed the scarce documentation.
  3.  RELEASE_20200207 is definitely broken (for example finding SDL for builds was fixed after the release), instead check out master's HEAD.
The contrib folder in the repo contains a functional cmake setup, running the usual cmake-make combo there produced a statically linked library for SoLoud with SDL2 backend, which I could link into my project. I suggest others to do the same.
Reply all
Reply to author
Forward
0 new messages