Thread: possible to link and run with .lib file without .dll file?

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    1,579

    possible to link and run with .lib file without .dll file?

    Hello everyone,


    I usually link with .lib file and when program executes, it will look for .dll file to load real function implementations.

    I heard that it is possible to link with .lib file and the program can run without .dll file (.dll file needs not be generated and not needed at all during program execution). Is that correct? If it is, could anyone introduce some online tutorials about this topic?


    thanks in advance,
    George

  2. #2
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    Look up static and dynamic linking.


    Roughly....


    A static library (or DLL) is 'built' into the app (by the complier) when you create the exe. there is no need for the target computer to have a copy of the library (DLL). This makes the exe bigger.

    A dynamic link means that the DLL (or library) is opened when the app runs. The DLL must be on the target PC or the app will fail.

    An app can also call a DLL with LoadLibrary(), GetProcAddress() ect and use the functions within. The DLL can then be 'dropped' when it is no longer required. Dynamic linking allows you to modify code without rebuilding your exe.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. To find the memory leaks without using any tools
    By asadullah in forum C Programming
    Replies: 2
    Last Post: 05-12-2008, 07:54 AM
  2. Formatting a text file...
    By dagorsul in forum C Programming
    Replies: 12
    Last Post: 05-02-2008, 03:53 AM
  3. Getting a C# program with a manifest file to run in the debugger
    By Xarzu Athanasop in forum C# Programming
    Replies: 0
    Last Post: 01-18-2008, 06:34 PM
  4. Double print
    By thestrap in forum C Programming
    Replies: 1
    Last Post: 12-05-2007, 07:17 PM