Wednesday 14 October 2009

Invalid search path '%LIB%' specified in 'LIB environmental variable' 'The system cannot find the path specified

I had a little problem installing Visual Studio 2008 on a 64 bit version of Windows 2003 with NAG libraries. On the 32 bit Windows 2003 Server the solution compiled but on the 64 bit version I got the error:

Warning as Error: Invalid search path '%LIB%' specified in 'LIB environmental variable' 'The system cannot find the path specified.

One thing is that the path is slightly different between the different versions:
LIB = "C:\Program Files\Numerical Algorithms Group\FLDLL204Z"
LIB = "C:\Program Files (x86)\Numerical Algorithms Group\FLDLL204Z"

But the real problem was solved by
1. Goto MyComputer—> Properties—-> Advanced Settings—-> and click Environment Variables
2. Delete User and System Variables for LIB ONLY (you need to keep the system variable)
3. Reboot

NB if you don't reboot the problem remains. It really is necesary to reboot