Changing the DLL reading filepath from it's .lib file.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • thegrb93
    New Member
    • Jul 2008
    • 2

    Changing the DLL reading filepath from it's .lib file.

    I am kind of new to DLLs, but I am using a library provided from the maker of lua which contains all of it's major functions.

    I want my exe to read the DLL from <dir>\bin rather than in <dir> (The same folder).

    I think that I have to go into the .lib file and change the addresses of where VC++ reads from lua51.dll to bin\lua51.dll, but after trying that VC++ said the library was corrupt.
    I am basically just trying to change where the exe requires the dll to be. Any suggestions or solutions to this?
  • oler1s
    Recognized Expert Contributor
    • Aug 2007
    • 671

    #2
    I think that I have to go into the .lib file and change the addresses of where VC++ reads from lua51.dll to bin\lua51.dll, but after trying that VC++ said the library was corrupt.
    What did you expect? If you change things about what you don’t understand, you’ll break your code.

    I am basically just trying to change where the exe requires the dll to be. Any suggestions or solutions to this?
    Then you have to late bind the dll. If you bind the dll at compile time, then Windows will look for the dll in a predetermined number of directories. The first being the same directory as the exe.

    Comment

    • thegrb93
      New Member
      • Jul 2008
      • 2

      #3
      Thanks for the suggestion. I looked up late binding, but I was kind of shocked because I will have to go into lua's header files and write the linker functions to all of the functions dependent on the DLL. It might be a lot of work, but looks like it has a lot of advantages too, like error handling.

      Comment

      Working...