How to fix build warning: Invalid search path ‘C:Program FilesMicrosoft Visual StudioVC98mfclib’ specified in ‘LIB environment variable’ — ‘The system cannot find the path specified. ‘

I recently upgraded from VS 2005 to VS 2008. It was all peaches and cream until I started getting this mysterious error. If you do a search, the MSDN blog will come up with this post.

Unfortunately, the person writing the blog didn’t write the actual instructions in the blog, and the links are totally out of date! What to do??? Fortunately for us, my former team ( Go Brent Serbus, Don Tan, and crew! ) and helpful MVP Taylor Michael come to the rescue.

I’ll distill his wisdom into some more easily followed steps ( XP, I haven’t got on the Vista train yet ):

  1. Go into Control Panel -> System -> Advanced -> Environment Variables
  2. You’ll see a variable called LIB. The old entries if you use all the default values will look like something from the Title of the blog post. You should be getting 1 warning per offending entry in the LIB variable.
  3. Delete all the entries that are causing your problems. I know its scary. Take a deep breath and do it. Apparently this is some holdover from VS 2005/2003 that doesn’t get updated with the installer/updater.
  4. Restart Visual Studio.
  5. Voila! Your warnings should be gone.

Hope this helps. It drove me nuts looking for a straight answer.


5 thoughts on “How to fix build warning: Invalid search path ‘C:Program FilesMicrosoft Visual StudioVC98mfclib’ specified in ‘LIB environment variable’ — ‘The system cannot find the path specified. ‘

  1. Different source; similar symptoms! Our issue was a setting in the LIB environment variable left behind years and years ago by some evaluation software. Visual Studio said it couldn’t find the path to the library files shipped with the eval product. However, your solution worked well. In this case, our environment is VS2010 running on Windows 7. Deleting the LIB environment variable solved it for us, allowing us to compile for release again.

    Before finding your post, we tracked it to the registry but were cautious about making changes…especially deleting a Key!

    So, thank you! Here are a couple of ways to locate LIB Environment (and other) Variable(s) in Windows 7:

    1. On the Start menu, right click on Computer (found on the right panel) and choose the Properties item at the bottom of the context menu. When the basic info windows appears, select “Advanced system settings” from the left panel. This will open a System Properties window. Click the “Environment Variables…” button found toward the bottom of the window. Follow the rest of the steps above.


    1. Edit the Registry, navigate to the following location, and delete the LIB entry:
    HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Environment

    • Wow, an actual working solution, written in ENGLISH, not programer-ese or gibberish, that makes no assumptions and gives step-by-step procedures. Someone should buy this person a beer. Thanks a bunch.

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 )

Google+ photo

You are commenting using your Google+ 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