Linker Tools Error LNK2038 (original) (raw)

mismatch detected for 'name': value 'value_1' doesn't match value 'value_2' in filename.obj

A symbol mismatch has been detected by the linker. This error indicates that different parts of an app, including libraries or other object code that the app links to, use conflicting definitions of the symbol. The detect mismatch pragma is used to define such symbols and detect their conflicting values.

Possible causes and solutions

This error can occur when an object file in your project is out-of-date. Before you try other solutions to this error, perform a clean build to ensure that the object files are current.

Visual Studio defines the following symbols to prevent the linking of incompatible code, which can cause run-time errors or other unexpected behavior.

Ensure that the values of these symbols are consistent throughout the projects in your Visual Studio solution, and also that they're consistent with code and libraries that your app links to.

Third-party library issues and vcpkg

If you see this error when you are trying to configure a third-party library as part of your build, consider using vcpkg, a C++ package manager, to install and build the library. vcpkg supports a large and growing list of third-party libraries, and sets all the configuration properties and dependencies required for successful builds as part of your project.

See also

Linker Tools Errors and Warnings