简体   繁体   中英

.tlb files not generating in vcxproj .rc file

On building my project is giving error of not generating (.tlb) file in (vcxproj .rc) file:

error RC2135: file not found: DocOutPPML.tlb [C:\\ElxVC\\SRC\\OutputConverters\\DocOutPPML\\DocOutPPMLCHS.vcxproj]

Using visual studio 2010 I converted this proj from vcproj to 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.

/TLBOUT:[path]filename

Where

path: An absolute or relative path specification for where the .tlb file should be created.

filename: Specifies the name of the .tlb file created by the MIDL compiler. No file extension is assumed; specify filename.tlb if you want a .tlb extension.

Remark

  1. The /TLBOUT option specifies the name and extension of the .tlb file.
  2. The MIDL compiler is called by the Visual C++ linker when linking projects that have the module attribute.
  3. If /TLBOUT is not specified, the .tlb file will get its name from /IDLOUT filename. If /IDLOUT is not specified, the .tlb file will be called vc70.tlb.

To set this linker option in the Visual Studio development environment

  • Open the project's Property Pages dialog box. For details, see Setting Visual C++ Project Properties.

  • Click the Linker folder.

  • Click the Embedded IDL property page.

  • Modify the Type Library property.

You can specify the right name for the "(.tlb) file" in the command line:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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