Jump to content
  • Advertisement
Sign in to follow this  

Questions About Using DLLs and LIBs

This topic is 4391 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

Hello. I've never created a DLL before, but thought I'd give it a try with my game engine. I've read several articles and a short article here at GameDev about the subject, but I'm still a bit confused. Using a DLL should allow me to alter (the implementations of) my classes in my engine without the need to recompile the programs that use the engine. Also, it seems that certain unchanging aspects of the engine are best left statically linked. First of all, how do I make a certain component statically linked? Do I just omit the __declspec(dllexport) declaration? So far, that's what I've done. Also, what use is __declspec(dllimport)? When do I use it? I thought using __declspec(dllexport) removed the need for a DEF file and that without a DEF file I wouldn't need __declspec(dllimport). Is this wrong? Also, I thought that any libraries (OpenGL, SDL, OpenAL, etc.) that the DLL project linked with would not have to be linked to by the project using the DLL! Is this also wrong? My test project that uses the DLL produces linker errors unless I link it also with the libraries that the DLL project links with. This was one big reason I decided to try using DLLs instead of just static LIBs, but it's not working. (The test project does link to the LIB file produced by the DLL project, as expected. I thought that would be all I needed.) Are DLLs slower to use? What are the other benifits? I know they ease distribution and reduce file sizes. Any help is really appreciated. Thanks, everyone.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!