## “cannot open type library file” error on x64 systems

By , May 18, 2012 11:18 am

I’ve just tried building a Visual Studio 2010 helper DLL on Windows 7 x64.

The build failed with “cannot open type library file vsmso.olb : No such file or directory”.

A quick search found them in c:\program files (x86)\microsoft shared\MSEnv. This is the folder for 32 bit applications (Visual Studio is a 32 bit application).

OK, so if the files are present on the machine why does the build fail for this line?

```	//The following #import imports VS Command Bars
#import <vsmso.olb> raw_interfaces_only named_guids
```

The reason is the Visual Studio project include directories are setup for c:\program files\microsoft shared\MSEnv. You need to edit the properties for Debug and Release for each processor type (in my case Win32 and x64) and change the include directory (or add another include directory) c:\program files (x86)\microsoft shared\MSEnv then rebuild.

This is a potential non-obvious timewaster. Hope I’ve saved you some time.

Problem solved.

### One Response to ““cannot open type library file” error on x64 systems”

1. Beth’s favourite method (and one I’m coming around to) of dealing with this sort of platform specific include path is to use .vprops (VS2003-2008) or .props (VS2010/VS11) files. We do it this way for platform specific (non-header) libraries such as ADO, GoogleTest etc., but it can also have some advantages even for header only libraries such as WTL.

The advantage of this is that you don’t need to set up each machine individually – just pull the property files from source control.

Panorama Theme by Themocracy