Linker Error Segment _text Exceeds 64k
for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Ask a Question Ask for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Expand Search Submit Close Search Login Join Today Products BackProducts Gigs Live Careers Vendor Services Groups Website Testing Store Headlines Experts Exchange > Questions > _TEXT Segment Exceeds 64K Want to Advertise Here? Solved _TEXT Segment Exceeds 64K Posted on 1997-05-23 C 1 Verified Solution 3 Comments 2,069 Views Last Modified: 2011-09-20 I just inherited some c code which runs on a Janus barcode scanner device. It was developed using the Borland C compiler on the PC. I guess the barcode device runs a mini version of DOS. I've made no source changes yet, I'm trying to get the existing code to build using the Borland C++ 4.5 environment. Problem #1 - I get a bunch of warnings from Bcc regarding 'Possibly incorrect assignment...' and then a message: Error: Unable to execute command 'tlink.exe' Problem #2 - When I run tlink manually, I get the the following error: >tlink esd.obj d:\bc45\lib\ch.lib Turbo Link Version 7.00 Copyright (c) 1987, 1994 Borland International Error: Segment _TEXT exceeds 64K Thanks for any insight you have. -- John P.S. I have used the -mh option for Bcc to indicate the huge memory model, and as the tlink command line indicates, I have been attempting to link with ch.lib library for the huge memory model. Is there something I'm missing in the Borland command line directives? 0 Question by:johnjab Facebook Twitter LinkedIn Google LVL 2 Best Solution bytovergaard I think the second problem is because you are using a wrong memory model. Check what the documentation says you must use, if no documentation or no info about memory model, try to use large or huge memory Go to Solution 3 Comments LVL 2 Overall: Level 2 C 1 Message Accepted Solution by:tovergaard1997-05-23 I think the second problem is because you are using a wrong memory model. Check what the documentation says you must use, if no documentation or no info about memory model, try to use large or huge memory model. The first problem, part 2, unable to execute command tlink.exe is often cause by a wrong setup. I.e. the setup don't point to the library with the tlink, or no path to the program. The first problem, part 1, it is a warning, so dont care if you haven't changed the program. 0 Message Author Comment by:johnjab1997-05-23 Edited text of question 0 Message Author Comment by:johnjab1997-05-27 It turns out that my qu
van GoogleInloggenVerborgen veldenZoeken naar groepen of berichten
64K" Could someone explain to me what it does mean? It is not doccumented in my Borland C++ 2.0 books. How could I correct this problem? I tried http://computer-programming-forum.com/47-c-language/bbfb1f9b7926650b.htm to break my big source file in five parts, but it didn't change http://www.verycomputer.com/12_14ff1b1aa2fdfa73_1.htm anything. BTW my programm is written in C, not in C++. Thank You! Norm. Tue, 07 Feb 1995 09:05:11 GMT Keith Ri#2 / 7 Linker Error: Segment _TEXT exceeds 64K Quote:>"Linker Error: Segment _TEXT exceeds 64K" >Could someone explain to me what it does mean? It is not doccumented in >my linker error Borland C++ 2.0 books. How could I correct this problem? I tried to >break my big source file in five parts, but it didn't change anything. >BTW my programm is written in C, not in C++. >Thank You! >Norm. Try compiling it with a COMPACT memory model. -- Keith Tue, 07 Feb 1995 14:25:05 GMT Desmarais Norma#3 / 7 Linker Error: Segment _TEXT exceeds linker error segment 64K Ok! There is no more Linker Error since I change the memory model to Medium size. Thanks to Alexander Kardanev, Timothy D. Goss and Ander Thulin for the hint! Norm. Tue, 07 Feb 1995 23:50:06 GMT Tim Fro#4 / 7 Linker Error: Segment _TEXT exceeds 64K Quote: >>"Linker Error: Segment _TEXT exceeds 64K" >Try compiling it with a COMPACT memory model. No! Compact gives you the same 64k limit for code (TEXT) as does the default small model. You need Medium or Large model to get past this limit. Read the section in the programmer's guide about memory models for more info. :::: Tim Frost :::::::::::::: Roundhill Computer Systems Limited :::: :::::::::::::::::::::::::::::::::::: Marlborough SN8 1SU England :::: Wed, 08 Feb 1995 03:43:53 GMT Keith Ri#5 / 7 Linker Error: Segment _TEXT exceeds 64K Quote: >>>"Linker Error: Segment _TEXT exceeds 64K" >>Try compiling it with a COMPACT memory model. >No! Compact gives you the same 64k limit for code (TEXT) as does the default >small model. You need Medium or Large model to g
the newsgroup appropriate to your problem. I added this group and fixed follow-up to it. :> program in C using Turbo C++ 3. The program uses a :> linked list that needs to grow to several hundred K, so I switched to the :> "compact" model rather than "small". Once you've done that, you then use 32 bits pointers for data, and still 16 bits pointers for the code. So the entire code is contrained to be less than 64K in size. :> I did a "Build All" and everything :> seemed fine. However, after I did a few days more work on the project the :> message :> :> Linker Error: Segment _TEXT exceeds 64K :> :> appeared several times. I did a "Build All" just to make sure I wasn't :> mixing up my .OBJ files and so forth, but the error persisted. :> :> I looked this up in the Turbo C manual, and it said to split my source :> code up into more files. I did this and the problem went away. Good. I'm puzzled this alone worked. :> Until... :> I extended the program further, the error message came back, and I am now :> unable to get rid of it! I've tried splitting my source code up even more :> (each file is now only about 20k and contains about 0-10k of Code and Data :> as shown in the Project Window) There is one easy solution : go to the "large" model. Then, code will use 32 bits pointers for all references. The immediate benefit is that the code can then grow to more than 64K. Until... Until you reach the next barrier, which is usally the limit of the processor addressing space. This is one is 1M, constrained to 640K by the early designers of the PC. If you think 640K is big enough, think that this quantity must be shared between all the programs, including DOS itself. If you hit this barrier, the next solution is to go to the flat model, i.e. a full 32-bits OS