title: Using stdlib.h functions directly in assembly
body: <p>I have to do an assembly (x86) program that takes 2 long numbers from user input, adds them using a function and then prints the result. When I use the read syscall I get a string in ASCII hex code and I can't add the numbers like that. So I wanted to use atol that is a function of stdlib.h to convert the string to long. How can I include libraries in assembly? Is there another way to do this?  </p>
  
  <p>I have already tried: </p>
  
  <ol>
  <li><code>.file "stdlib.h"</code> (I have the lib in the current directory)</li>
  </ol>
  
  <p>error: undefined reference to <code>atol'</code></p>
  
  <ol start="2">
  <li>compiling stdlib.h with the .s file together using clang</li>
  </ol>
  
  <p>error: stdlib.h: file not recognized: File format not recognized</p>
  
  <ol start="3">
  <li>making a .c file with only <code>#include&lt;stdlib.h&gt;</code> and compiling it with the .s file </li>
  </ol>
  
  <p>error: undefined reference to `atol'</p>
  
  <p>the comads I run are </p>
  
  <pre><code>clang function.s -c -g
  ld function.o -o function
  </code></pre>