Last Modification: June 30, 2006

  When building my application or dll, I get error LNK1104: cannot open file 'xxx.lib' or error C1083: ‘cannot open include file xxx.h’

  This is caused by the fact that the linker or compiler cannot find the specified file. Make sure the linker or compiler knows where to look.

Explanation

By default, the build tools will only look for include files and lib files (*) in the current working directory.

If the specified file is not found, the tool will look for the file in any alternate locations that have been configured. If it is still not found in one of those locations, it will report an error.

These alternate locations can be configured in 2 ways.

The first option is to make these locations global to your visual studio options. This has the advantage that you only have to configure it once. The disadvantage is that you have to remember to reconfigure this setting if you want to build your project on another computer.

The second option is to configure this in your project settings. This has the advantage that you can build your project on all development computers that have the appropriate SDKs installed at the same location. The disadvantage is that you have to reconfigure this setting for each new project and configuration, unless you make these settings part of a custom project template.

One common way to configure your system is to add folders to the global visual studio settings if you use them nearly always (for example the Platform SDK), and add them to your project settings if they are specific to that project.

To configure this in Visual C++ 6

To configure this in Visual C++ 2003 / Visual C++ 2005