我正在尝试编写 C++ 应用程序并收到链接器错误,我想我需要进入项目设置 (Visual Studio) 并添加一个 lib 文件,但我不知道该文件的名称和位置,我怎样才能知道?

#include "framework.h" 
#include "aviDrawDX.h" 
#include "aviDrawDX.h" 
#include "shellscalingapi.h" 
#include "windows.h" 
#include <winuser.h> 
 
#define MAX_LOADSTRING 100 
 
// Global Variables: 
HINSTANCE hInst;                                // current instance 
WCHAR szTitle[MAX_LOADSTRING];                  // The title bar text 
WCHAR szWindowClass[MAX_LOADSTRING];            // the main window class name 
 
// Forward declarations of functions included in this code module: 
ATOM                MyRegisterClass(HINSTANCE hInstance); 
BOOL                InitInstance(HINSTANCE, int); 
LRESULT CALLBACK    WndProc(HWND, UINT, WPARAM, LPARAM); 
INT_PTR CALLBACK    About(HWND, UINT, WPARAM, LPARAM); 
 
int APIENTRY wWinMain(_In_ HINSTANCE hInstance, 
                     _In_opt_ HINSTANCE hPrevInstance, 
                     _In_ LPWSTR    lpCmdLine, 
                     _In_ int       nCmdShow) 
{ 
    SetProcessDpiAwareness(PROCESS_SYSTEM_DPI_AWARE); 
 
1>aviDrawDX.obj : error LNK2019: unresolved external symbol SetProcessDpiAwareness referenced in function wWinMain 
1>C:\Users\frank\Daten\Projekte\CPP\aviDrawDX\x64\Debug\aviDrawDX.exe : fatal error LNK1120: 1 unresolved externals 
1>Done building project "aviDrawDX.vcxproj" -- FAILED. 

请您参考如下方法:

问题已解决,我需要在链接器选项中添加 shcore.lib。


评论关闭
IT虾米网

微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!