Comment on: C/C++ and large file sizes (over 2GB)
1 10 Jul 2015 13:47 u/RiderRockon in v/programmingComment on: C/C++ and large file sizes (over 2GB)
After a bit of digging I think I might be doing something wrong with the compiler flag, as sizeof( off_t ) still returns 4. Here's what I use to compile the project.
gcc -c src/cryption.cpp -I include -L lib -D_FILE_OFFSET_BITS=64
gcc -c src/main.cpp -I include -L lib -D_FILE_OFFSET_BITS=64
echo ----------------
g++ -o cryption main.o cryption.o -I include -L lib -D_FILE_OFFSET_BITS=64
Comment on: C/C++ and large file sizes (over 2GB)
I gave that a shot. However when I run this on a large file it returns -1. I'm using MinGW on Windows for this, but that shouldn't matter, should it?
Yes! That seems to work for me as well! Thank you!
That seems a rather oddly specific way to do it though.