Jump to content
  • Advertisement
Sign in to follow this  
StoneDevil

creating dll and lib in Visual Studios .NET 2003

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

hey im trying to create my own library that i can use as a sound manager and so on. what im wondering is how i set up my project to create a dll and a lib file. right now i can only choose to create one or the other. ive never made my own dll or liv so i dont know a lot about it but could someone help me out with this thanks

Share this post


Link to post
Share on other sites
Advertisement
When a MSVC DLL project is built it will build both the DLL and the LIB file for the DLL automatically by default.

Share this post


Link to post
Share on other sites
so if i just create an empty project and change the settings to compile to a dll it should make both the dll and lib

because ive tried a win32 project and set it to compile as a dll...and it only compiles a dll file and no lib....

Share this post


Link to post
Share on other sites
Did you actually export any functions? An import library won't be generated if there's nothing to import.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
i dont know how to export any functions...o rif i am or not...

can you explain how to do this

Share this post


Link to post
Share on other sites
In order to export a function you declare it as __declspec(dllexport). If you look up dllexport in the MSDN documentation it should give you an explanation of how to use it.

Share this post


Link to post
Share on other sites
Here's a quick guide though pictures [smile]:

Free Image Hosting at www.ImageShack.us Free Image Hosting at www.ImageShack.us
For a DLL:
Free Image Hosting at www.ImageShack.us

For a Static Library:
Free Image Hosting at www.ImageShack.us

When you make a DLL and follow those options I selected, you will get a mini guide in the generated code that shows how to create the DLL.

When you make a static library like those options I selected, you just add in your .cpp and .h files and compile into the .LIB.

Now when you make a .DLL there are a lot of gotcha's associated with it, so I'd reccomend you use a static lib to start out with, and once you get comfortable with using that, then you can switch over to a .DLL. Of course you'd prob need to make some test DLLs first, to fully get what happens when you use them and so on.

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!