Build COM add-in using github acctions. Gettting error C4772

gigasoft 21 Reputation points

Hi, We have a COM add-in (MFC C++ ATL) that we have been building locally without any issues. We decided to move this to GitHub actions and build our product on the cloud. We ran into a huge problem when we tried to import the outlook object model (type library), like the following.

#import "msoutl.olb" \
	auto_rename auto_search raw_interfaces_only no_function_mapping rename_namespace("Outlook")\
	rename("CopyFile", "__CopyFile")\
	rename("PlaySound", "__PlaySound")
using namespace Outlook;

We get the following error.

error C4772: #import referenced a type from a missing type library; '__missing_type__' used as a placeholder

After reading several items on the web, we have determined that we are missing registry entries, most importantly the following.


We really want to do the GitHub actions.  Is there a way to accomplish this?

Thanks is advance.

Tom -

A family of Microsoft email and calendar products.
2,624 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,294 questions
{count} votes

Accepted answer
  1. RLWA32 38,856 Reputation points

    @gigasoft You already have Outlook's type library and presumably any others that you might need.

    Give this a try --

    1. On your local system do a build in which the code uses the #import directive.
    2. Copy the headers created by the #import directive to an appropriate folder in your solution renaming .tlh and .tli as needed to .h (it may be necessary to edit the generated files if .tlh refers to .tli)
    3. Comment out the #import directive and replace with #include statements for the generated headers.
    4. Test if you can successfully build locally using generated headers without #import.
    5. If successful try building same using Github actions.
    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. gigasoft 21 Reputation points

    Get errors .\MSOUTL.IDL(2397) : error MIDL2025 : syntax error : expecting a type specification near "OlObjectClass" .\MSOUTL.IDL(2397) : error MIDL2026 : cannot recover from earlier syntax errors; aborting compilation

    0 comments No comments