构建成功,但没有创建 .lib 文件 [英] Build Succeeded, but no .lib file gets created

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

问题描述

我继承了大量代码,包括一个应该(尽我所知)构建 .lib 文件的 Visual Studio 项目.Visual Studio 说...生成代码...创建库...创建浏览信息文件...",最后,它说构建成功.在 release/debug 文件夹中,它有一堆 .obj 文件,但它没有 .lib 文件.我可能会遗漏什么?

I inherited a substantial amount of code, including a visual studio project that is supposed to (as best as I can tell) build a .lib file. Visual studio says "... Generating Code... Creating Library... Creating browse information file...", and at the end, it says the build succeeded. In the release/debug folder, it has a bunch of .obj files, but it doesn't have a .lib file. What could I be missing?

谢谢!

推荐答案

打开项目属性(在解决方案资源管理器中右键单击项目,选择属性").在图书管理员"下,选中输出文件" - 这就是输出应该去的地方.

Open the Project Properties (right-click the project in Solution Explorer, select 'Properties'). Under 'Librarian', check 'Output File' - that's where the output should go.

如果这看起来正确,请在适合您项目的子目录中尝试 dir/s *.lib,看看您是否可以按日期和时间定位输出库.如果仍然找不到,请尝试干净重建(右键单击项目,选择重建").

If this looks right, try dir /s *.lib in a suitable subdirectory for your project, to see if you can locate the output library by date and time. If you still can't find it, try a clean rebuild (right click project, select 'Rebuild').

对于 DLL,如果 DLL 不为外部使用导出任何内容,则不会创建 .Lib 文件.我认为这不适用于静态库构建,但我会确保您从库项目源代码中导出公共内容.

For DLLs, a .Lib file is not created if the DLL exports nothing for external usage. I don't think this applies for static lib builds but I would make sure you are exporting something public from your library project source code.

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

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