关于apue.h头文件使用问题
在VM虚拟机上安装了Linux,但是在Linux下却无法编译《Unix环境高级编程》中的例子,错误提示是没有apue.h头文件。
上网把问题搜索了下,发现提供的解决方法,貌似Linux都不是安装在VM虚拟机的!
希望有此问题经验的高人能解答下!
谢谢了!
apue.h不是标准库头文件,
它应该是作者自己写的,是为了方便代码共享,减少重复代码数。
这个头文件网上搜索应该是可以下的到的。
看看apue.h的内容,自己手工加一个.
apue英文版第3版的附录B就是apue.h
对于中文版,应该也能在附录中找到
自己去网上搜一下把附录的代码下载下来!
具体参照http://www.cnblogs.com/cnhome/archive/2010/03/30/1701024.html
把目录的代码自己朝下来写一个
开启ssh服务,用sftp传上去就行了
在Linux系统中 vi apue.h
然后把附录中的内容贴上去..
vm直接就可以把windows的文件共享到linux里!!!
自己点点vm的菜单你就会发现
http://wenku.baidu.com/view/02a427b765ce0508763213d8.html
要说道方法 简直太多了
ftp
sftp
scp
samba
安装vm tools 然后直接把文件拖拽到虚拟机窗口里
U盘
……
jf
这个问题说明没有认真看书
英文版第二版:1194页:
/* Our own header, to be included before all standard system headers */
#ifndef _APUE_H
#define _APUE_H
#define _XOPEN_SOURCE 600 /* Single UNIX Specification, Version 3 */
#include <sys/types.h> /* some systems still require this */
#include <sys/stat.h>
#include <sys/termios.h> /* for winsize */
#ifndef TIOCGWINSZ
#include <sys/ioctl.h>
#endif
#include <stdio.h> /* for convenience */
#include <stdlib.h> /* for convenience */
#include <stddef.h> /* for offsetof */
#include <string.h> /* for convenience */
#include <unistd.h> /* for convenience */
#include <signal.h> /* for SIG_ERR */
#define MAXLINE 4096 /* max line length */
/*
* Default file access permissions for new files.
*/
#define FILE_MODE (S_IRUSR
S_IWUSR
S_IRGRP
S_IROTH)