[Solved] C++ Compile: error LNK2019: unresolved external “XX“

Link error: linker tools error LNK2019

The error prompt error LNK2019: unresolved external "XX" often appears during the compilation of C + + projects. The main reason is that the definition of the corresponding reference variable or function cannot be found in the currently referenced library during the linking process. At this time, you need to add the library that defines the reference variable to the corresponding project.

There are two main ways to solve this problem:

To manually add the powrprof.lib </KBD> library, do the following:

Method 1: use #pragma comment , such as
#pragma comment (LIB, "powrprof. Lib") method 2: properties under the corresponding item in vs: enter the corresponding position
Properties > Configuration Properties > Linker > Input > Additional dependencies add the powrprof.lib library, as shown in the following figure:


Read More: