ca****@gmail.com wrote:
Hi,
I have g++ 3.3.2 installed on sun solaris sparc machine and I am trying
to to read files greater than 2gb.
I compile the code as follows:g++ -D_FILE_OFFSET_BITS=64
-D_LARGEFILE_SOURCE -v -o Test test.cpp
Anyone any ideas why my program will not read over 2 gb.
Regards
Fergal
This is actually the wrong newsgroup for compiler-specific settings.
(Try a GNU-specific newsgroup).
It may well have something to do with the typedefs in char_traits<char>
so you could write your own traits class that uses 64-bit addresses.
Use these
typedef std::streampos pos_type;
typedef long long off_type;
typedef std::mbstate_t state_type;
if "long long" is 64-bit on your compiler as it is off_type in
char_traits that can cause the problems.