confusion in linking process

This is a discussion on confusion in linking process within the C Programming forums, part of the General Programming Boards category; when we run the command to compile a program, the results we get are, a .obj file and .exe file. ...

  1. #1
    Registered User
    Join Date
    Feb 2009
    Posts
    9

    confusion in linking process

    when we run the command to compile a program, the results we get are, a .obj file and .exe file.

    as far as I know, .obj file is created by compiler and .exe file by linker however, since the .exe file also created at the same time hence it make me thinking about that the linker is also called when we run the command for compilation.

    is that so?

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,712
    Maybe the command that you are running is named "build", since "build" is often used to mean "compile and link". On the other hand, sometimes people use "compile" when they mean "compile and link".
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Beyond what Laserlight says, many compilers (including Turbo C, gcc and MS Visual Studio) support "linking using the compiler", where if you do NOT specify a flag (-c or similar) to say "only compile this, don't link it", the compiler starts the linker after it has finished compiling the source code. So essentially, the linker is being run in a separate process, but it is done as part of one single command - the compile command.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. init adopts zombie process?
    By password636 in forum Linux Programming
    Replies: 4
    Last Post: 07-01-2009, 10:05 AM
  2. Replies: 3
    Last Post: 10-15-2008, 09:24 AM
  3. Problem with forking a process
    By Unitedroad in forum C Programming
    Replies: 10
    Last Post: 10-04-2007, 01:43 AM
  4. process programming
    By St0rM-MaN in forum Linux Programming
    Replies: 2
    Last Post: 09-15-2007, 07:53 AM
  5. ICMP packet / process confusion
    By eth0 in forum Networking/Device Communication
    Replies: 0
    Last Post: 05-24-2005, 04:17 PM

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