在Ubuntu 12.04系統下配置apue2環境。
0、為了操作方便,建議使用root權限。
1、下載源碼包,解壓至某個目錄,比如:/root/apue.2e。
-------------------------------------------------------------
免費下載地址在 http://linux.linuxidc.com/
用戶名與密碼都是www.linuxidc.com
具體下載目錄在 /2013年資料/1月/8日/Ubuntu 12.04 配置apue2環境
-------------------------------------------------------------
2、將/root/apue.2e/Make.defines.linux中第6行WKDIR=/home/sar/apue.2e更改為/root/apue.2e。
3、將/root/apue.2e/ipp/ipp.h中第122行中的status換為Status。(也可換為其他,但要與下面對應)
4、將/root/apue.2e/ipp/printd.h中第977行中的status替換為Status。(與上面對應)
5、將/root/apue.2e/threadctl/getenv1.c和/root/apue.2e/threadctl/getenv3.c中第1行#include <limits.h>更換為#include <linux/limits.h>。
6、此時,如果編譯通過,會在/root/apue.2e/lib/目錄下生成libapue.a靜態鏈接庫文件。
7、將/root/apue.2e/lib/libapue.a拷貝至/usr/local/lib/目錄下。
8、將/root/apue.2e/include/apue.h拷貝至/usr/local/include/目錄下。
9、編譯示例:gcc main.c -lapue 。
OVER!