Visual C++ fatal error LNK1158 midl.exe

ok. Dang it I don’t like C++ and I was getting this error trying to compile a solution. Since searching in google doesnt give anything (do c++ developers use the internet yet?) I am posting this here for the next unlucky soul. What it means is that file is missing from an executable path or include path. What I did to fix was find midl.exe in another directory (C:Program FilesMicrosoft Visual Studio .NET 2003Common7ToolsBin to be exact) and then copied it to

C:program filesMicrosoft Visual Studio .NET 2003Vc7bin


C:program filesMicrosoft Visual Studio .NET 2003SDKv1.1Bin

and then my solution finally compiled. 🙂

By Steve Novoselac

Director of Digital Technology @TrekBikes, Father, Musician, Cyclist, Homebrewer

One reply on “Visual C++ fatal error LNK1158 midl.exe”


the problem with midl.exe is that some installation programs extend the environment variable PATH in an improper way. If it happens again, or someone else has this problem, I recommend checking the PATH environment and fix all spurious entries. It should work then as expected. I had this problem several times, and right now I fixed it by removing a path entry having quotes (a DirectX SDK gift ;-).

all the best


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.