title: SDL2 on Raspbian/Debian
body: <p>I'm trying to link SDL2 on Raspbian Stretch, which is debian-based.</p>
  
  <p>I followed <a href="https://wiki.libsdl.org/Installation#Linux.2FUnix" rel="nofollow noreferrer">the instructions</a>:</p>
  
  <blockquote>
    <p>Debian-based systems (including Ubuntu) can simply do "sudo apt-get install libsdl2-2.0" to get the library installed system-wide, and all sorts of other useful dependencies, too.</p>
  </blockquote>
  
  <p>But I have no idea where in the world that installed it and a find . -name **sdl* didn't really help... meanwhile my build command in gnat still tells me it's not finding anything:</p>
  
  <pre><code>gnatmake -g main.adb -Isource -I../source/win -I../source -I../SDL2 -gnatwk -gnatwr -gnatwu -D objectFiles -largs -lSDL2 -lSDL2_Mixer -lSDL2_ttf obj1.o obj2.o
  (...)
  /usr/bin/ld: cannot find -lSDL2
  /usr/bin/ld: cannot find -lSDL2_Mixer
  /usr/bin/ld: cannot find -lSDL2_ttf
  (...)
  </code></pre>
  
  <p>So I tried building myself according to the instructions below that:</p>
  
  <blockquote>
    <p>If you're compiling SDL yourself, here's what we refer to as "the Unix
    way" of building:</p>
    
    <ul>
    <li>Get a copy of the source code, either from Mercurial or an official tarball or whatever.</li>
    <li>Make a separate build directory (SDL will refuse to build in the base of the source tree).</li>
    <li>Run the configure script to set things up.</li>
    <li>Run "make" to compile SDL.</li>
    <li>Run "make install" to install your new SDL build on the system.</li>
    </ul>
    
    <p>This looks something like this:</p>
  
  <pre><code>hg clone https://hg.libsdl.org/SDL SDL
  cd SDL
  mkdir build
  cd build
  ../configure
  make
  sudo make install
  </code></pre>
  </blockquote>
  
  <p>Everything did what it was supposed to do (or at least nothing said it DIDN'T do what it was supposed to do) but now I still don't know how to link it. I tried copying the libsdl2.so file to the working directory and changing -lSDL2 to -llibsdl2 but no luck. Obviously I need to do the same procedure with the other libraries but I was hoping I could worry about one at a time.</p>
  
  <p>There are further instructions but they seem to apply specifically to C:</p>
  
  <blockquote>
    <p>Once you have the library installed, you can use the sdl2-config
    program to help you compile your own code:</p>
  
  <pre><code>gcc -o myprogram myprogram.c `sdl2-config --cflags --libs`
  </code></pre>
  </blockquote>
  
  <p>And I don't know how to do something similar for Ada.</p>
  
  <p>Problem is, I just have no experience linking in Linux and all the stuff I can find on the internet is so general I can't apply it to my case.</p>
  
  <p>As for why in the world I would want to do this, building this for Raspberry Pi wasn't something I intended from the start of the project, but it has kind of become important for me to be able to do so.</p>
  
  <p>Does anyone know how I can get this working? I can build it with no problem on Windows, so it's really just a matter of getting the library into a state where I can like it for a build on Linux.</p>