Sign in to follow this  

Questions About Using DLLs and LIBs

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this