我以前也发生过这种情况,但我不记得我是如何解决的。
我无法在新安装的 Ubuntu 上编译一些程序……我的标题有问题。
我试过 g++-4.1 和 4.3 无济于事。
g++ -g -frepo -DIZ_LINUX -I/usr/include/linux -I/usr/include -I/include -c qlisttest.cpp
/usr/include/libio.h:332: error: ‘size_t’ does not name a type
/usr/include/libio.h:336: error: ‘size_t’ was not declared in this scope
/usr/include/libio.h:364: error: ‘size_t’ has not been declared
/usr/include/libio.h:373: error: ‘size_t’ has not been declared
/usr/include/libio.h:493: error: ‘size_t’ does not name a type
/usr/include/stdio.h:294: error: ‘size_t’ has not been declared
...
文件...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
...
@ubuntu:~/work/zpk/src$ cat /usr/include/linux/types.h | grep size_t
typedef __kernel_size_t size_t;
typedef __kernel_ssize_t ssize_t;
types.h 肯定在路径中,并且正在被拾取。我通过更改文件名进行了验证,并得到了一个错误,它丢失了......
有没有人有任何想法...?我真的很感激你的帮助......