Search code examples
visual-studiocomvisual-studio-2019idl

What runtime dependencies does TLBIMP have?


Setting up a clean build machine I have only installed VS2019 so far, including Windows 10 SDK, as far as 3rd-party software is concerned.

An ODL file has custom compile step:

midl /out ..\dll %(FullPath)
TLBIMP ../dll/%(Filename).tlb /namespace:MyOrg.COM /keyfile:../include/MyOrg.snk /out:../dll/%(Filename).dll

This gives the build error:

1>'TLBIMP' is not recognized as an internal or external command, 1>operable program or batch file. 1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(231,5): error MSB6006: "cmd.exe" exited with code 9009.

Clearly MIDL is working, what additional Visual Studio/Windows components do I need to install for TMPLIB?


Solution

  • As Simon points out in comments, TLMIMP.exe is a standard VS tool. Depending which Windows SDK is being used it should be found in:

    • C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\TlbImp.exe
    • C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools

    You might have multiple versions installed, which is used during a build will depend on your %PATH variable. This would normally be set whenever you run Visual Studio Developer Command Prompt (I assume if you build within the IDE it's done automatically).

    My issue was actually that I'm building with Azure Devops and it doesn't automatically add this folder to the build path.