title: Compiling C++ program with POSIX AIO lib on Linux
body: <p>I'm having difficulty with the linker when it comes to compiling a sample program that uses the POSIX aio library (e.g. aio_read(), aio_write(), etc) on Linux.</p>
  
  <p>I'm running Ubuntu with a 2.6 kernel, and have used the apt-get utility to install libaio. But even though I'm linking with the aio library, the compiler still gives me linker errors.</p>
  
  <pre><code>root@ubuntu:/home# g++ -L /usr/lib/libaio.a aio.cc -oaio
  /tmp/cc5OE58r.o: In function `main':
  aio.cc:(.text+0x156): undefined reference to `aio_read'
  aio.cc:(.text+0x17b): undefined reference to `aio_error'
  aio.cc:(.text+0x191): undefined reference to `aio_return'
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p>Where are all these aio_x functions actually defined, if not in the library libaio.a? </p>