title: Are SDL's linker options mentioned in the official documentation?
body: <p>I started using <a href="https://github.com/libsdl-org/SDL" rel="nofollow noreferrer">SDL2 library</a> with <a href="https://www.codeblocks.org/" rel="nofollow noreferrer">Code::Blocks</a> IDE under windows. I downloaded the binary files for mingw64 which I use to compile, and I Included the search directories in the Compiler and Linker options.</p>
  <p>My simple program would not compile:</p>
  <pre><code>//Using SDL and standard IO
  #include &lt;SDL.h&gt;
  #include &lt;stdio.h&gt;
  
  
  int main( int argc, char* args[] )
  {
  
  //Initialize SDL
  SDL_Init( SDL_INIT_VIDEO );
  
  //Quit SDL subsystems
  SDL_Quit();
  
  return 0;
  }
  </code></pre>
  <p>Returning me the errors:</p>
  <blockquote>
  <p>main.c:13: undefined reference to `SDL_Init'</p>
  </blockquote>
  <blockquote>
  <p>main.c:16: undefined reference to `SDL_Quit'</p>
  </blockquote>
  <blockquote>
  <p>undefined reference to `WinMain'</p>
  </blockquote>
  <p>Turns out I missed to use the linker options:</p>
  <pre><code>-lmingw32 -lSDL2main -lSDL2
  </code></pre>
  <p><a href="https://i.stack.imgur.com/GyO6N.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GyO6N.png" alt="linker options lsd" /></a></p>
  <p>I was not able to find out that I missed the linker options, without the help of <a href="https://lazyfoo.net/tutorials/SDL/01_hello_SDL/windows/codeblocks/index.php" rel="nofollow noreferrer">this tutorial</a> and other online forums. I was looking in the official documentation and wiki of the SDL and this is not mentioned anywhere.</p>
  <p>Since this happens often to me (I go and try to use a library, the official documentation does not mention the important steps to compile the library. Sometimes it doesnt mention the files you need to include, others it does not mention the linker options one needs.). My question is:</p>
  <p>How would someone using SDL library, find out they need to use these linker settings without the help of forums and tutorials? Could I found out from the errors it gave me upon compiling maybe?</p>
  <p>I do not make the question general, I emphasize in this specific library, but the issue I have is general.</p>