Jump to content
  • Advertisement
Sign in to follow this  
hlivingstone

linking static vs dynamic (in context of directx)

This topic is 5471 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

My apologizes for this question, as its very newb and probably doesn’t belong in this area, save for the context in which I’m asking it in...So we press onto the question hence forth: hehe Why is it necessary to statically link to directx library files (d3d9.lib dinput.lib ect) since they are already linked to dynamic ones at runtime? I understand why the dynamic ones are required, but why the static libraries? Unless I'm mistaken I didn’t think this was always required when using dll files, thus this being a special case...correct me if I'm wrong. Also is there a corresponding dll file loaded per each lib file you include at compile time, or is this on a case by case basis? I'm curious as to this, because I'm considering differing their loading until they are absolutely required in my project. And am wondering if there are other directx dlls I should differ which I don’t know about. Thanks

Share this post


Link to post
Share on other sites
Advertisement
Even if you make your own DLL files, you have two ways to access them.

1. Have the compiler automatically create a .lib with stubs that call the DLL functions.
2. Figure out the .def file you need to export functions in the DLL. In your app, call LoadLibrary(), FindFunction(), cast the result to an appropriate function pointer, and call the function.

It's just easier to have the .lib stubs take care of the details of interfacing to a DLL.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!