但我不想要.lib或.exp文件为我的COM库! [英] But I don't want that .lib or .exp file for my COM library!

查看:227
本文介绍了但我不想要.lib或.exp文件为我的COM库!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当使用VisualStudio生成COM dll时,我真正需要的是 DllCanUnloadNow 符号(以及三个相关的) dll本身。 没有人会链接到我的图书馆,所以我对.lib文件和.exp文件都不感兴趣。

When generating a COM dll with VisualStudio, all I really need is the DllCanUnloadNow symbol (and three related ones) to be exported from the dll itself. Nobody is going to link against my library, so I'm not (at all) interested in a .lib file, nor in an .exp file.

但是,我不能禁止这些文件的创建。 (注意:我知道如何在后期构建步骤中删除它们)

However, I don't manage to inhibit creation of these files. (note: I do know how it's possible to remove them in a post-build step)

这些是我的链接器参数:

These are my linker arguments:

/OUT:"u:/cada-nt/bin/PData.dll" 
/INCREMENTAL:NO 
/NOLOGO 
/DLL 
/MANIFEST:NO 
/DEF:"PData.def" 
/DEBUG 
/PDB:"u:/cada-nt/pdb/PData.pdb" 
/ERRORREPORT:PROMPT kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib 
                    advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib 
                    odbc32.lib odbccp32.lib

问题:


  • 有人成功生成了.lib和.exp文件吗?

  • 有人知道为什么生成?

  • Has anyone succeeded in not generating the .lib and .exp files?
  • Does anyone know why these files are generated?

推荐答案

Visual Studio的链接器具有 / IMPLIB 选项允许您指定的输出位置。 .lib .exp 文件。

Visual Studio's linker has an /IMPLIB option that allows you to specify the output location for your .lib and .exp files.

您可以在项目属性:

Configuration Properties > Linker > Advanced > Import Library

您可以将其设置为以下内容,例如:

You might set it to the following, for example:

$(Configuration)\$(TargetName).lib

链接器将使用与 .lib 相同的名称创建 .exp 文件。

The linker will create the .exp file using the same name as the .lib.

这篇关于但我不想要.lib或.exp文件为我的COM库!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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