简体   繁体   English

.tlb文件未在vcxproj .rc文件中生成

[英].tlb files not generating in vcxproj .rc file

On building my project is giving error of not generating (.tlb) file in (vcxproj .rc) file: 在构建我的项目时出现错误,未在(vcxproj .rc)文件中生成(.tlb)文件:

error RC2135: file not found: DocOutPPML.tlb [C:\\ElxVC\\SRC\\OutputConverters\\DocOutPPML\\DocOutPPMLCHS.vcxproj] 错误RC2135:找不到文件:DocOutPPML.tlb [C:\\ ElxVC \\ SRC \\ OutputConverters \\ DocOutPPML \\ DocOutPPMLCHS.vcxproj]

Using visual studio 2010 I converted this proj from vcproj to vcxproj. 使用Visual Studio 2010,我将此项目从vcproj转换为vcxproj。

You need the resource compiler to have the correct path where to your type library. 您需要资源编译器具有正确的类型库路径。 The place where you can set this is under resource configuration propertygeneraladditional include directories . 可以在资源配置属性常规其他包含目录下进行设置 Just specify there where your type library is. 只需在其中指定类型库的位置即可。

You have to generate .tlb file. 您必须生成.tlb文件。

/TLBOUT:[path]filename / TLBOUT:[路径]文件名

Where 哪里

path: An absolute or relative path specification for where the .tlb file should be created. path:应在其中创建.tlb文件的绝对或相对路径规范。

filename: Specifies the name of the .tlb file created by the MIDL compiler. filename:指定MIDL编译器创建的.tlb文件的名称。 No file extension is assumed; 不假定文件扩展名; specify filename.tlb if you want a .tlb extension. 如果要扩展名为.tlb,请指定filename.tlb。

Remark 备注

  1. The /TLBOUT option specifies the name and extension of the .tlb file. / TLBOUT选项指定.tlb文件的名称和扩展名。
  2. The MIDL compiler is called by the Visual C++ linker when linking projects that have the module attribute. 当链接具有模块属性的项目时,Visual C ++链接器将调用MIDL编译器。
  3. If /TLBOUT is not specified, the .tlb file will get its name from /IDLOUT filename. 如果未指定/ TLBOUT,则.tlb文件将从/ IDLOUT文件名获取其名称。 If /IDLOUT is not specified, the .tlb file will be called vc70.tlb. 如果未指定/ IDLOUT,则.tlb文件将称为vc70.tlb。

To set this linker option in the Visual Studio development environment 在Visual Studio开发环境中设置此链接器选项

  • Open the project's Property Pages dialog box. 打开项目的“属性页”对话框。 For details, see Setting Visual C++ Project Properties. 有关详细信息,请参见设置Visual C ++项目属性。

  • Click the Linker folder. 单击链接器文件夹。

  • Click the Embedded IDL property page. 单击“嵌入式IDL”属性页。

  • Modify the Type Library property. 修改类型库属性。

You can specify the right name for the "(.tlb) file" in the command line: 您可以在命令行中为“(.tlb)文件”指定正确的名称:

midl <your>.idl /tlb <any>.tlb
  1. Open the project's Property Pages dialog box. 打开项目的“属性页”对话框。 For details, see Set C++ compiler and build properties in Visual Studio. 有关详细信息,请参见在Visual Studio中设置C ++编译器和生成属性。
  2. Click the Build Events folder. 单击“ 生成事件”文件夹。
  3. Click the Pre-Build Event property page. 单击“ 预构建事件”属性页。
  4. Modify the Command Line property. 修改命令行属性。
echo === Log ===
cd "$(ProjectDir)"
midl.exe DocOutPPML.idl /tlb DocOutPPML.tlb
cd "$(TargetDir)"
echo ===

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM