在Ubuntu 8.1上,g ++ - 4.1或其他版本找不到size_t [英] size_t can not be found by g++-4.1 or others on Ubuntu 8.1

查看:863
本文介绍了在Ubuntu 8.1上,g ++ - 4.1或其他版本找不到size_t的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这发生在我之前,但我不记得我如何修复它。

This has happened before to me, but I can't remember how I fixed it.

我无法在新的Ubuntu安装中编译一些程序。

I can't compile some programs here on a new Ubuntu install... Something is awry with my headers.

我试过g ++ - 4.1和4.3无效。

I have tried g++-4.1 and 4.3 to no avail.

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绝对在路径中,我通过更改文件名验证,并得到一个错误,它的丢失...

types.h is definitely in the path, and is getting picked up. I verified by changing the file name and get an error its missing...

有没有人有任何想法...?我真的很感谢帮助...

Does anyone have any ideas...? I would really appreciate the help...

推荐答案

开始删除-I / usr / include / linux和-I / usr /包括。添加系统目录以手动包括路径或者没有效果,或者打破了东西。此外,请删除-frepo以提高额外的安全性。

Start by removing -I/usr/include/linux and -I/usr/include. Adding system directories to include paths manually either has no effect, or breaks things. Also, remove -frepo for extra safety.

这篇关于在Ubuntu 8.1上,g ++ - 4.1或其他版本找不到size_t的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆