程序迁移中关于fpos_t的问题

C、C++和Java语言
回复
lianxz
帖子: 4
注册时间: 2006-08-04 15:54
送出感谢: 0
接收感谢: 0

程序迁移中关于fpos_t的问题

#1

帖子 lianxz » 2006-09-11 16:00

原来程序是可以在unix和windows下跑的,在原来的平台上fpos_t是和off_t或者long int等价的,所以下面的语句可以:
fpos_t m_nContentSize = 0
但是在ubuntu下编译时上面的语句出错:
错误: no match 为 ‘operator=’ 在 ‘((CFileFlow*)this)->CFileFlow::m_nContentSize = 0’ 中 4 /usr/include/_G_config.h:30: 附注: 备选为: _G_fpos_t& _G_fpos_t:: operator=(const _G_fpos_t&)

stdio.h中:
typedef _G_fpos_t fpos_t
_G_config.h中:
typedef struct
{
__off_t __pos;
__mbstate_t __state;
} _G_fpos_t;

官方的Manual也是这么说的:
This is the type of an object that can encode information about the file position of a stream, for use by the functions fgetpos and fsetpos.

In the GNU system, fpos_t is an opaque data structure that contains internal data to represent file offset and conversion state information. In other systems, it might have a different internal representation.

想请问我的程序怎么样才能移植到Ubuntu上来呢?
回复

回到 “C/C++/Java”