0

so, I am trying to implement this API: https://sol.gfxile.net/soloud/ So far I downloaded the project, added the lib folder to libraries, wrote a simple test program, tried compiling, and I just get bunch of linker errors saying "unresolved external symbol". I tried checking if there were any .dll and/or .lib files, but there are none. IDK what I'm doing wrong, this is already 3rd library I tried implementing(as out of boredom I'm working on 3 simultaneous small projects), and I failed miserably in all of them. Could someone please help me?

My code to test out the library:

#include "soloud.h"
#include "soloud_wav.h"
#include <iostream>
#include <string>
#define WITH_MINIAUDIO
#define SOLOUD_NO_ASSERTS

int main() {
    std::string path;

    std::cin >> path;
    SoLoud::Soloud soloud; // Engine core
    SoLoud::Wav sample;    // One sample

    // Initialize SoLoud (automatic back-end selection)
    soloud.init();

    sample.load(path.c_str()); // Load a wave file
    soloud.play(sample);        // Play it

    soloud.deinit();
    return 0;
}

one of the errors:

Severity    Code    Description Project File    Line    Suppression State
Error   LNK2019 unresolved external symbol "public: __cdecl SoLoud::AlignedFloatBuffer::AlignedFloatBuffer(void)" (??0AlignedFloatBuffer@SoLoud@@QEAA@XZ) referenced in function "public: __cdecl SoLoud::Soloud::Soloud(void)" (??0Soloud@SoLoud@@QEAA@XZ) Console Audio Player    C:\Users\Matej\source\repos\Console Audio Player\Console Audio Player\Source.obj    1   

enter image description here

  • ***added the lib folder to libraries*** Adding a library folder does not mean link to the libraries in the folder. That would only happen if the library used a `#pragma comment(lib, libname)` on a compiler that supports this pragma. However because that is compiler specific an open source library may not use this. You likely need to add the library to "Linker->Input->Additional Dependencies" – drescherjm Jan 31 '22 at 00:20
  • @drescherjm I said it wrong. I mean I added include folder to additional include libraries. I mixed the lib folder with another of the 3 projects I'm working in where I'm using library who's lib folder consists solely of .h files. On this library lib folder consists of 2 files ("soloud_static.idb" and "soloud:static.pdb") – matej drenjančevič Jan 31 '22 at 00:24
  • Setting the include directory without linking the library will also cause this type of error. – drescherjm Jan 31 '22 at 00:26
  • @drescherjm but there are no libraries to link. I searched for *.dll *.lib and there are none. – matej drenjančevič Jan 31 '22 at 00:29
  • That depends on how you install and if you build the library from source. There is a quick start here: [http://sol.gfxile.net/soloud/soloud_20200207.html#quick-start](http://sol.gfxile.net/soloud/soloud_20200207.html#quick-start) which tells you one method is to add all source files to your c++ project. ***You can, for example, include all the SoLoud source files to your project, define one or more of the backend defines (see table below), and you're good to go.*** – drescherjm Jan 31 '22 at 00:33
  • @drescherjm well, that is what I did. I added source files to the project folder(and added folders with headers to additional headers), included soloud.h and soloud_wav.h, and #define WITH_MINIAUDIO – matej drenjančevič Jan 31 '22 at 01:46

0 Answers0