title: undefined reference to `htole32'
body: <p>error occurs while compiling the following c code on CentOS release 4.3. </p>
  
  <pre><code>#include &lt;endian.h&gt;
  #include &lt;stdint.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  int main(int argc, char *argv[])
  {
      union {
          uint32_t u32;
          uint8_t arr[4];
      } x;
  
      x.arr[0] = 0x11;   
      x.arr[1] = 0x22;
      x.arr[2] = 0x33;
      x.arr[3] = 0x44;  
  
      printf("x.u32 = 0x%x\n", x.u32);
      printf("htole32(x.u32) = 0x%x\n", htole32(x.u32));
      printf("htobe32(x.u32) = 0x%x\n", htobe32(x.u32));
  
      exit(EXIT_SUCCESS);
  }
  </code></pre>
  
  <p>Details of compiling errors:</p>
  
  <blockquote>
    <p>$ gcc a.c  /tmp/ccki8bVg.o(.text+0x3a): In function <code>main': :
    undefined reference to</code>htole32' /tmp/ccki8bVg.o(.text+0x58): In
    function <code>main': : undefined reference to</code>htobe32' collect2: ld
    returned 1 exit status</p>
  </blockquote>
  
  <p>It seems that there isn't htole32 and htobe32 on my server.</p>
  
  <blockquote>
    <p>$ man htole32 
    No manual entry for htole32</p>
  </blockquote>