Linking errors in Visual Studio 2010 MFC – updated

In Visual Studio 2010 MFC, when linking to a library (.lib) gets you the horrible ‘error LNK2001: unresolved external symbol’ message and you are 100% sure the library and the current project has the same compile time parameters check if you did not used the ‘using namespace’ directive prior to the unresolved external symbol thing. The linker will try to find the required symbols in the last namespace you defined and might not be the same with the namespace of the .lib file.

Other causes for this error might be the fact that the library and your project is not compiled with the same parameters like: Runtime Library, Character Set, Use of ATL, Use of MFC, etc.

To easily include a library in your project add the library project to the Solution, then “Add New Reference …” button in the Property Pages of the project that need to use that library.

Tags: , , ,

Leave a Reply