Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

creating .lib file in Visual Studio

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

like image 717
Mike D Avatar asked Aug 24 '09 13:08

Mike D


2 Answers

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.)

like image 100
erelender Avatar answered Oct 25 '22 03:10

erelender


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.

like image 34
Henrico Dolfing Avatar answered Oct 25 '22 02:10

Henrico Dolfing