CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2009
    Posts
    68

    .lib and .dll files

    Hello,

    I'm sure this is a very simple issue, but it is confusing me a lot right now. So I am writing a program which uses a .dll file and a .lib file. I don't know much about these, but from what I gather, the .lib file is used to create the final .exe, whereas the .dll is left alone as an independent file.

    Assuming this is correct, then I tell my compiler (Visual Studio) where to find the .lib file, by specifying "Additional Library Directories" and "Additional Dependencies" in the project properties. However, this is just for the .lib file, and not the .dll files, right?

    So, my question is, how does my program know where to find the necessary .dll file when it comes to running the executable? Is there a directory setting similar to "Additional Library Directories" which I need to change?

    Thanks!

  2. #2
    Join Date
    Oct 2002
    Location
    Austria
    Posts
    1,284

    Re: .lib and .dll files

    Your program doesn't need to know. The OS loads the dll. I don't exactly know where Windows looks for dll's but I know it does look in the directory where the executable is.
    Kurt
    EDIT: http://msdn.microsoft.com/en-us/library/ms682586%28VS.85%29.aspx
    Last edited by ZuK; July 6th, 2010 at 01:16 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured