title: How to install a C++ library (OpenAL)
body: <p>I'm having difficulties installing the OpenAL audio library in C++. I guess the headers are in the correct folder and the problem is in the lib files, because VS Code doesn't show any error when I include the library (<code>#include &lt;AL/al.h&gt;</code> and <code>#include &lt;AL/alc.h&gt;</code>), but when I try to compile my code from the terminal I get the following error:</p>
  <pre><code>C:\Users\ALEXAN~1\AppData\Local\Temp\ccNZ4t3C.o:Proves.cpp:(.text+0x1c): undefined reference to `__imp_alcOpenDevice'
  C:\Users\ALEXAN~1\AppData\Local\Temp\ccNZ4t3C.o:Proves.cpp:(.text+0x30): undefined reference to `__imp_alcCloseDevice'
  collect2.exe: error: ld returned 1 exit status
  </code></pre>
  <p><strong>Where and how I've installed the library:</strong></p>
  <p>I've downloaded and unziped the <a href="https://www.openal-soft.org/#download" rel="nofollow noreferrer">Windows binaries</a>. Then I've run the <code>cpp -v</code> command to find the C++ include directories, which showed 3 directories. I moved the <code>AL</code> folder (that contains the headers) to the <code>C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\x86_64-w64-mingw32\include</code> directory and the Win32 lib files (called <code>libOpenAL32.dll.a</code>, <code>OpenAL32.def</code> and <code>OpenAL32.lib</code>) to the <code>C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\x86_64-w64-mingw32\lib</code> directory. I'm not sure if I have to put there the 3 of them or just the one called <code>libOpenAL32.dll.a</code>.</p>
  <p>I know there are similar posts on stackoverflow and I've read some of them, but it's the first time I install a library in C++ and it's difficult for me to understand them. If someone could provide a clear explanation on how to complete the installation I'd be very grateful.</p>