Apue is the UNIX environment advanced programming, almost all the programs in this book contain a apue.h header file, how to configure this apue.h?
1, we can download in the Http://pan.baidu.com/s/1dDxmtbF, and then put on your Linux desktop (no desktop, feel free to put it)
2. Unzip the downloaded file:
Tar-zxv-f src.3e.tar.gz
3. Enter the extracted directory:
CD apue.3e/
4. Compiling:
Make
We will find that the following error occurred:
Can,t Find-lbsd
5. Download and add the libbsd.a static link library:
sudo apt-get Install Libbsd-dev
6. Compile again:
Make
Should be successful at this time, we put apue.h and libapue.a into the corresponding directory, with the following command to complete:
sudo cp./include/apue.h/usr/include/sudo cp. /lib/libapue.a/usr/local/lib/
Why would you want to move Libapue.a to/usr/local/lib?
The reason is that LIBAPUE.A is the concrete implementation of all functions and macro definitions contained in the Apue.h header file, and is a static link library.
View ld.conf.d/libc.conf you will find that GCC will search the link library by default when searching for files in/usr/local/lib/, so we'll put it here, once and for all .... (But I need to know OH)
7. Test environment:
The program on the GCC book. C-o Output name-lapue (Libapue.a here to write apue, specific GCC use rules can man, hehe)
Adapted from: http://blog.sina.com.cn/s/blog_94977c890102vdmu.html
Linux Configuration Apue Compiler environment