title: Linking error with "math.h" - What option to tell the linker to link with it?
body: <p>I'd like to use <code>math.h</code> in C++ Builder 10.1.2.</p>
  
  <p>Unfortunately, there is a linker error when I try to call one of <code>math.h</code>'s functions.
  What I do already know is, that (for historical reasons) the linker must be explicitly set to link to use the <strong>math</strong> lib.
  <a href="https://stackoverflow.com/questions/1033898/why-do-you-have-to-link-the-math-library-in-c">See here</a>.</p>
  
  <p>In <strong>gcc</strong> this can be done via the <code>-lm</code> flag.</p>
  
  <p>But what do I have to enter for C++ Builder in the <em>Project options</em> => <em>C++ Linker</em> =><em>Advanced options</em> field to make this work?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>So here is an example:
  Create a new VCL project and change the Form1 code like that:</p>
  
  <pre><code>//---------------------------------------------------------------------------
  
  #include &lt;vcl.h&gt;
  #pragma hdrstop
  
  #include "Unit1.h"
  
  #include &lt;math.h&gt;
  //-------------------------------------------------------------------------- -
  #pragma package(smart_init)
  #pragma resource "*.dfm"
  TForm1 *Form1;
  //---------------------------------------------------------------------------
  __fastcall TForm1::TForm1(TComponent* Owner)
      : TForm(Owner)
  {
      float a = floorf(0.0f);
  }
  //---------------------------------------------------------------------------
  </code></pre>
  
  <p>That will give you the linker error</p>
  
  <pre><code>[ilink32 Error] Error: Unresolved external '_floorf' referenced by C:\USERS\FLKO\DOCUMENTS\EMBARCADERO\STUDIO\PROJECTS\WIN32\DEBUG\UNIT1.OBJ
  </code></pre>
  
  <p>So I need to tell the linker to link with the <code>math</code> lib.</p>
  
  <p>But how?</p>