Linker error _text exceeds 64K

This is a discussion on Linker error _text exceeds 64K within the C Programming forums, part of the General Programming Boards category; Linker error _text exceeds 64K.I must do it . I do everting but not result. I make large project.I to ...

  1. #1
    Registered User
    Join Date
    Jan 2006
    Location
    Thailand
    Posts
    6

    Unhappy Linker error _text exceeds 64K

    Linker error _text exceeds 64K.I must do it . I do everting but not result. I make large project.I to try to split in section but still error(Linker error _text exceeds 64K) any body help me,please.I sent project to teacher

  2. #2
    ... kermit's Avatar
    Join Date
    Jan 2003
    Posts
    1,528
    What sort of compiler are you using?

  3. #3
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,246
    What compiler are you using?

  4. #4
    ex-DECcie
    Join Date
    Dec 2005
    Posts
    125
    Also, what platform are you working on?

    One handy little trick is to take that error, paste it into the search box on Google and see what you find.....

  5. #5
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    What odds do you give me it's Turbo C 2.x?

    [edit]
    We could start a pool.

    TC 1.x --
    TC 2.x -- My vote.
    TC 3.x --
    Miracle C --
    ...insert something else here...
    [/edit]

    Quzah.
    Last edited by quzah; 01-06-2006 at 08:54 PM.
    Hope is the first step on the road to disappointment.

  6. #6
    Registered User
    Join Date
    Jan 2006
    Location
    Thailand
    Posts
    6
    i use turbo c++ 3.0

  7. #7
    Registered User
    Join Date
    Jan 2006
    Location
    Thailand
    Posts
    6
    I try post error in google but read unknowable

  8. #8
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,006
    If your operating system is not actual DOS, then get a newer compiler.
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  9. #9
    cwr
    cwr is offline
    Registered Luser cwr's Avatar
    Join Date
    Jul 2005
    Location
    Sydney, Australia
    Posts
    868
    Quote Originally Posted by Dave_Sinkula
    If your operating system is not actual DOS, then get a newer compiler.
    And if it is actual DOS, then get a newer operating system

  10. #10
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,447
    Probably means that all the code is in the same .c file, and now it's time to split that file up into several modules (each of which will get their own 64K).

    But even when you've done that, you also need to tell the compiler to use say "large" model code.

  11. #11
    Registered User
    Join Date
    Jan 2006
    Location
    Thailand
    Posts
    6
    I must sent teacher,Uhhhhh unnn ,i want to cry.uhhh

  12. #12
    Registered User
    Join Date
    Jan 2006
    Location
    Thailand
    Posts
    6
    I already TELL compiler large model but still not result.hmmmmmmmm.ummmmmmmm,I want to cry!

  13. #13
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,447
    > I already TELL compiler large model but still not result
    That's only half the job - you also need multiple source files. The compiler will put each source file into a separate 64K section, but if you only have ONE source file, then you haven't actually done much.

    Example, this is what you have
    Code:
    // main.c
    #include <stdio.h>
    void someFunc ( int param ) {
      printf( "hello, someFunc called with %d\n", param );
    }
    int main ( ) {
      printf( "Hello from main\n" );
      someFunc ( 1234 );
      return 0;
    }
    // which would be compiled with
    // cc main.c
    Exactly how you call your compiler (probably not cc) is up to you.

    But you want to get into this kind of situation here, two source files and a header file.
    Code:
    // func.c
    #include <stdio.h>
    #include "func.h"
    void someFunc ( int param ) {
      printf( "hello, someFunc called with %d\n", param );
    }
    
    // func.h
    #ifndef FUNC_H_INCLUDED
    #define FUNC_H_INCLUDED
    void someFunc ( int param );
    #endif
    
    // main.c
    #include <stdio.h>
    #include "func.h"
    int main ( ) {
      printf( "Hello from main\n" );
      someFunc ( 1234 );
      return 0;
    }
    // which would be compiled with
    // cc main.c func.c
    Exactly how many func.c files you need is entirely up to you, but since you've probably just gone over the limit, and with no time left, I would suggest just two files.
    Put half your functions in func.c, put all the prototypes for those functions in func.h and leave the rest in your main.c file.

  14. #14
    Registered User
    Join Date
    Jan 2006
    Location
    Thailand
    Posts
    6
    thank you very much everybody . i make project finish.and it perfect too.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linker problem... no idea
    By cyreon in forum C Programming
    Replies: 2
    Last Post: 04-03-2009, 02:53 PM
  2. linker
    By George2 in forum C++ Programming
    Replies: 6
    Last Post: 02-23-2008, 12:25 AM
  3. I am gonna kill myself...linker error !!!
    By roalme00 in forum C++ Programming
    Replies: 1
    Last Post: 09-02-2007, 11:34 AM
  4. Linker errors in VC++ 2005
    By C+/- in forum C++ Programming
    Replies: 0
    Last Post: 05-18-2007, 07:42 AM
  5. Linker errors with Visual C++
    By codegirl in forum C++ Programming
    Replies: 4
    Last Post: 09-11-2003, 09:20 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21