Difference between .lib file and .obj file

sushant005

sushant005

@sushant005-tyt4WK Oct 21, 2024
What is the difference between using the *.lib file and the *.Obj file?

😁

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • sherya mathur

    sherya mathur

    @sherya-mathur-cI63wY May 10, 2010

    The .lib file is a file that has the stuff the linker needs to build your executable program. Windows cannot use them, but compilers and linkers can. Its a lot like a .obj file really, except it contains everything needed for all the stuff in your 'library' whereas an obj is from a single source file. It also contains a protocol for the associated .dll (basicaly, offsets of where functions start, the name and parameters(?) of the functions, calling conventions(?) and things like this).

    A .dll can have a lot of different stuff -- data, functions, anything really. A dll that has shared routines is what the OS needs to run those routines -- compare this to a 'mini executable'. A program smoothly jumps from its own executable statements to the ones in the .dll and back again. Windows does some smoke and mirrors here to make the file loading efficient(ish).
  • sushant005

    sushant005

    @sushant005-tyt4WK May 10, 2010

    @sherya
    can you elaborate it please "It also contains a protocol for the associated .dll".
    .
    what the protocol means in that envoirnment.