Sign in to follow this  

Making a .lib from a .dll project

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

I know when I go to build other libraries, one project makes both the dll and lib. If I'm making my own dll project, how can I configure it to generate a corrosponding lib? And when they do generate a lib, is it just a bunch of links to the dll?

Share this post


Link to post
Share on other sites
Quote:

And when they do generate a lib, is it just a bunch of links to the dll?

Nope. Its a static library independent of the dll.

Quote:

I know when I go to build other libraries, one project makes both the dll and lib. If I'm making my own dll project, how can I configure it to generate a corrosponding lib?

What do you mean?

If you are referring to configuating the project workspace, that is
compilier dependent.

If you are referring to properly exporting/importing symbols based
on if you are compiling this for a dll or not, this can be done
through the preprocessor.

Can you please elabrate?

Share this post


Link to post
Share on other sites
Quote:

Nope. Its a static library independent of the dll.

He's probably talking about an import library, a .lib that is statically-linked to your project when the library in question is really a DLL; this alleviates from you from having to manually LoadLibrary() and GetProcAddress() all the functions. It is basically a dummy forwarding library with no real code in it; the DLL is still required upon deployment.

Quote:

how can I configure it to generate a corrosponding lib?

Most IDEs will have an option to configure the project to generate an import library (sometimes this is enabled implicitly by finding the entry for "Import Library Filename" or some such and filling it in). You'll have to muck around in the project settings for your IDE.

You usually need to provide some (perhaps compiler-dependent) means of specifying which symbols to export. This is usually done via a .def-like file or via __declpec(dllexport), et cetera.

Share this post


Link to post
Share on other sites

This topic is 3843 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.

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