I am not absolutely sure of this but, I believe that a single array in FPC is limited to 2GB and your array exceeds that.Depends on platform. As in Delphi or C++. The limit you refer to is 32 bit platform (D7 Windows32?) and not even all of them..
if you got into the habit of paying attention instead of babbling the first thing that brews in your brain, you would have noticed:I am not absolutely sure of this but, I believe that a single array in FPC is limited to 2GB and your array exceeds that.Depends on platform. As in Delphi or C++. The limit you refer to is 32 bit platform (D7 Windows32?) and not even all of them..
And pointers for 32 bit code are unsigned in FPC, so double the amount.
He needs to mention Platform and Bitness, as usual. And the fpc version.
Error: Can't read COFF Header while reading C:\Users\<user>\Documents\SourceCode\CheckResFile\lib\x86_64-win64\xyzList.o"C:\users\"... not something you're going to see on many different OSs.
bufmax and property Size are of type Longint (4 bytes).
It has to be less than 2GB. Divide your array in half into two arrays in two different units.bufmax and property Size are of type Longint (4 bytes).
So the object files size(?) has to be smaller than 4GB, if i interprete that correctly?
But that file is "only" about 2,5GB.
I gonna try what happens, if i slightly reduce the array size. Sadly one "run" takes hours :-(
xyzList.pas is about 3,7 GB large and has about 10,7 million lines. Is there a way to compile that monster succesfully? It also dont help, that the IDE wont display that file...Wouldn't it be much easier to put those numbers in a CSV file (or plain text-file)? Converting the .pas text file with that array to a CSV/text file wouldn't be much work and you would be much more flexible. Ultimately you could/would transfer that CSV/text to a database because I can't see any advantage of that whole array directly in the executable (you already saw that with the time to run it).
This unit is generated by an export program to be used as part of a quick&dirty testing and integrity check routine. Worked well while the array was smaller, but now the compiler throws this error:
The array-solution had 2 reasons: easy human readable backup and an easy and fast way to access the data.writing a program that strips the unit of the pascal declarations leaving only the data retains both of those advantages. (at least, it looks that way.)
Dividing the array will make things more compilcated than necessary, because i can also read the original, compressed ressource file.
Even with two arrays it would exceed the maximum length as the file would still be > 2 GB. Better find another way to deal with that data than a static array.Not if each array is in a different unit (if you are referring to the object file)
Divide your array in half into two arrays in two different units.