title: Make and apply apue.h
body: <p>I started to learn APUE<sup><strong>*</strong></sup> and compile the source code </p>
  
  <ol>
  <li><p>Download the source code from <a href="http://www.apuebook.com/code3e.html" rel="nofollow noreferrer">Source Code</a> </p></li>
  <li><p>Extract it to </p>
  
  <pre><code>$ pwd
  /Users/me/Desktop/PubRepo/C/APUE/apue.3e
  </code></pre></li>
  <li><p>Read readme</p>
  
  <pre><code>$ cat readme
  Read the file called DISCLAIMER.
  
  On Freebsd, type "gmake".
  On other platforms, type "make" (as long as this is gnu make).
  
  For FAQs, updated source code, and the lost chapter, see http://www.apuebook.com.
  Please direct questions, suggestions, and bug reports to sar@apuebook.com.
  
  Steve Rago
  January 2013
  </code></pre></li>
  <li><p>I checked <code>make</code> version</p>
  
  <pre><code>$ make --version
  GNU Make 3.81
  Copyright (C) 2006  Free Software Foundation, Inc.
  This is free software; see the source for copying conditions.
  There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
  PARTICULAR PURPOSE.
  
  This program built for i386-apple-darwin11.3.0
  </code></pre></li>
  <li><p>make but report error:</p>
  
  <pre><code>gcc -ansi -I../include -Wall -DMACOS -D_DARWIN_C_SOURCE   -c -o sleep.o sleep.c
  making intro
  gcc -ansi -I../include -Wall -DMACOS -D_DARWIN_C_SOURCE  getcputc.c -o getcputc  -L../lib -lapue 
  ld: archive has no table of contents file '../lib/libapue.a' for architecture x86_64
  clang: error: unable to execute command: Segmentation fault: 11
  clang: error: linker command failed due to signal (use -v to see invocation)
  make[1]: *** [getcputc] Error 254
  make: *** [all] Error 1
  </code></pre></li>
  </ol>
  
  <p>I searched and found answer to add <code>cp ./lib/error.c /usr/local/include/</code></p>
  
  <pre><code>$ cp ./lib/error.c /usr/local/include/
  </code></pre>
  
  <p>make clean and make </p>
  
  <pre><code>making intro
  gcc -ansi -I../include -Wall -DMACOS -D_DARWIN_C_SOURCE  getcputc.c -o getcputc  -L../lib -lapue 
  ld: archive has no table of contents file '../lib/libapue.a' for architecture x86_64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  make[1]: *** [getcputc] Error 1
  make: *** [all] Error 1
  </code></pre>
  
  <p>The error is still there.</p>
  
  <p>How could I apply <code>apue.h</code>?</p>
  
  <hr>
  
  <p><strong>*</strong> <sub> W Richard Stevens, Stephen A Rago
  <a href="https://smile.amazon.com/dp/0321637739" rel="nofollow noreferrer">Advanced Programming in the Unix Environment, 3rd Edn</a>, 2013. </sub></p>