views:

213

answers:

4

I feel like an idiot asking such a basic question but for the life of me, I can't find much on this topic.

Anyway, how does one go about making a .lib file using Visual Studio (or whatever tool)?

Let's say I have a project or work space with one .cpp file and .obj in it.

TIA, Mike

A: 

look at the project properties. There will be one that says something like output type, you just choose library, as opposed to .exe.

Preet Sangha
+1  A: 

Go to Project->Properties. Under "General" set "Configuration Type" to "Static Library (.lib)". Then under "Linker" change the extension of the Output File to .lib . Then you're good to go. Remember to do these for all your configurations (Debug, Release etc.)

erelender
A: 

Go into proprties->Configuration Properties->General->Configuration type.

There you want to choose static library (.lib).

Then you just have to build it.

DanDan
+2  A: 

To create a new static library project

From the File menu, select New and then Project….

On the Project types pane, under Visual C++, select Win32.

On the Templates pane, select Win32 Console Application.

Choose a name for the project, such as MathFuncsLib, and enter it in the Name field.

Choose a name for the solution, such as StaticLibrary, and enter it in the Solution Name field.

Press OK to start the Win32 application wizard. On the Overview page of the Win32 Application Wizard dialog box, press Next.

On the Application Settings page of the Win32 Application Wizard, under Application type, select Static library.

On the Application Settings page of the Win32 Application Wizard, under Additional options, clear the Precompiled header check box.

Press Finish to create the project.

See here for more details.

Henrico Dolfing