在Visual Studio中创建.lib文件 [英] creating .lib file in Visual Studio

查看:498
本文介绍了在Visual Studio中创建.lib文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我觉得自己是个白痴,在问这样一个基本问题,但就我的一生而言,我在这个话题上找不到很多.

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

无论如何,如何使用Visual Studio(或任何工具)制作.lib文件?

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

假设我有一个包含一个.cpp文件和.obj的项目或工作空间.

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

TIA,迈克

推荐答案

创建新的静态库项目

从文件"菜单中,选择新建",然后选择项目…".

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

在项目类型"窗格的Visual C ++下,选择Win32.

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

在模板"窗格上,选择"Win32控制台应用程序".

On the Templates pane, select Win32 Console Application.

为项目选择一个名称,例如MathFuncsLib,然后在名称"字段中输入它.

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

选择解决方案的名称,例如StaticLibrary,然后在解决方案名称"字段中输入它.

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

按OK(确定)启动Win32应用程序向导.在"Win32应用程序向导"对话框的概述"页面上,按下一步".

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

在Win32应用程序向导的应用程序设置"页上,在应用程序类型"下,选择静态库".

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

在Win32应用程序向导的应用程序设置"页上的其他选项"下,清除预编译头文件"复选框.

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

按完成"创建项目.

有关更多详细信息,请参见此处.

See here for more details.

这篇关于在Visual Studio中创建.lib文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆