"linking"

This is a discussion on "linking" within the C++ Programming forums, part of the General Programming Boards category; I do not know what "linking" is. Well, I know it links source files, but how is this done?...

  1. #1
    Refugee face_master's Avatar
    Join Date
    Aug 2001
    Posts
    2,052

    "linking"

    I do not know what "linking" is. Well, I know it links source files, but how is this done?

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,855
    The compiler turns your source files into object files. For small programs, this will be a single file, but for large projects there will be many source files, not necessarily compiled at the same time.

    The linker takes all your object files, combines them with the runtime library (the bit which estabishes an environment which results in main() being called), and also searches additional libraries for library routines which you may have used in your code.

    If you're using gcc, then the -v command line option shows all the intermediate steps of pre-processor, compile, assemble, link
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Refugee face_master's Avatar
    Join Date
    Aug 2001
    Posts
    2,052
    does anybody know how to do that in Dev-C++ ??

Popular pages Recent additions subscribe to a feed

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