Question:
"_Text Segment Exceeds 64k" in Turbo C++?
Znal
2016-01-22 20:48:05 UTC
Hey all, so I am using Turbo C++ compiler version 4.0 for Windows 7 64-Bit. I'm trying to run a program and it created an error called Linker Error: _Text Segment Exceeds 64K. What should I do? If you need to know how large my .cpp file is it's 124k.
Four answers:
MeMeMe
2016-01-23 05:25:23 UTC
You're trying to build a DOS program right? Since DOS programs run in 16-bit mode there's a limitation of 64 KB per segment (unlike 32-bit or 64-bit which are limited to 4 GB and 16 EB respectively). In order to overcome this limitation it is possible to create .EXE files with multiple segments (COM files do not support this) and use far pointers and function to access data or code in different segments. Most compilers expose this in the form of a memory model:



- TINY: One segment for code and data

- SMALL: One segment for code, one segment for data, the default setting for most DOS compilers

- MEDIUM: One segment for data, multiple segments for code

- COMPACT: One segment for code, multiple segments for data

- LARGE: Multiple segments for code, multiple segments for data

- HUGE: Multiple segments for code, multiple segments for data, support for arrays that are larger than 64 KB.
?
2016-01-22 23:58:48 UTC
Too much data. It would help to know what data you have.



Possible solutions:-

Create data structures at run time.



Compress the data.



Move data into a file that is loaded at run time.
2016-01-22 20:50:38 UTC
Switch to a more modern IDE like "Code::Blocks".
?
2016-01-22 20:51:30 UTC
Run at 567k and decompile and then run the eingamizer.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...