【求助】程序迁移中关于fpos_t的问题
原来程序是可以在unix和windows下跑的,在原来的平台上fpos_t是和off_t或者long int等价的,所以下面的语句可以: % x1 S8 m8 Z! S1 p/ d ~
fpos_t m_nContentSize = 0
6 v/ x- J' {/ t" o+ q* d) I 但是在ubuntu下编译时上面的语句出错:
+ e0 @# g) n- y! P: ^/ s+ b6 b 错误: 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&) $ x+ q d/ r4 O
) ]3 l G: r# u$ Q# Q1 z$ R# f' s$ s
stdio.h中:
& X+ V& l4 X I4 j typedef _G_fpos_t fpos_t
3 e1 {9 J7 u+ ` _G_config.h中: 7 X7 s6 a3 b" A! _
typedef struct
# M, X. F3 D$ i {
- F( _5 i4 ~: h6 C! i# T' c __off_t __pos; % V! O3 V. b5 i# R* |
__mbstate_t __state;
' z, T8 V, O. ~# L% D } _G_fpos_t; , a* o2 G2 G+ m# `7 s" h( _
& N$ Q& h" @* D) _# j' m 官方的Manual也是这么说的: . K ~0 ?0 E: j6 s) {% A
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.
/ |) A6 Y- [" W3 y/ o1 L
. V4 y$ ]2 Y @ 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.
8 v7 y) E6 P* ]' Y; j9 @% y1 J7 Z
3 |' j x/ p9 D2 v# } 想请问我的程序怎么样才能移植到Ubuntu上来呢?
9 w4 a4 I1 y2 y8 ]3 f! I先谢了。