'inet_ntoa' not declared error
<p>I'm tring to use inet_ntoa function
writing to following code:</p>

<pre><code>printf("Got connection from: %s:%d\n", inet_ntoa(cli_addr.sin_addr.s_addr), cli_addr.sin_port);
</code></pre>

<p>Using the following includes:</p>

<pre><code>#include &lt;sys/socket.h&gt;
#include &lt;netinet/in.h&gt;
#include &lt;arpa/inet.h&gt;
</code></pre>

<p>But, using g++/gcc I'm  always get the error:</p>

<blockquote>
  <p>error: ‘inet_ntoa’ was not declared in this scope</p>
</blockquote>

<p>If I'm comment that line, the code is just fine.</p>

<p>Running under Ubuntu12.04.</p>

<p>Can anybody tell me what I missed?</p>

<p>Thanks!</p>