title: Build against rabbitmq-c
body: <p>I am trying to connect to rabbitmq in c and it is failing every single time. Here is how I did it.</p>
  
  <p>Downloaded rabbitmq-c
  <br/>
  Installed it (<code>make &amp;&amp; make install</code>) just to make sure dependencies are satisfied.
  <br/>
  Modified connection variables in <code>amqp_sendstring.c</code>
  <br/>
  Rebuilt using <code>make</code>, ran <code>./amqp_sendstring</code> and it worked
  <br/>
  Then I started creating my own files and compiling them through gcc using:
  <br/></p>
  
  <pre><code>gcc -lrabbitmq -o j_test test.c
  </code></pre>
  
  <p>Ironically it fails to link against librabbitmq with the errors below:</p>
  
  <pre><code>/tmp/cc63IlXq.o: In function `main':
  test.c:(.text+0xa): undefined reference to `amqp_new_connection'
  test.c:(.text+0x1a): undefined reference to `amqp_destroy_connection'
  collect2: ld returned 1 exit status
  </code></pre>
  
  <p>I removed everything starting with ampq_*. Voila! It was successfully built. That's to me an indicator that gcc is able to find the headers but not the lib.</p>
  
  <p>Here is test.c source code:</p>
  
  <pre><code>#include &lt;amqp.h&gt;
  #include &lt;amqp_framing.h&gt;
  int main(int argc, char const * const *argv) {
     amqp_connection_state_t conn;
     conn = amqp_new_connection();
     amqp_destroy_connection(conn);
     return 0;
  }
  </code></pre>
  
  <p>Would someone please point me to the right direction?</p>
  
  <p>Edit: I forgot to mention that I am on an ubuntu box (12.04). Think it is implicitly implied in the statements above though.</p>