简体   繁体   中英

I am getting C++ compilation issues while compiling my project

I am trying to implement the zoom sdk and want to prevent my screen to be captured and by screen shots for this purpose they have given some functions to be placed inside the project. When I place the code inside the function I start getting some errors and when I remove then the errors are gone. The code which need to be placed inside the project is as follows:

BOOL CALLBACK EnumWindowsCB(HWND hwnd, LPARAM lParam)
{
    SetWindowDisplayAffinity(hwnd, WDA_MONITOR);
    return TRUE;
}
void CZoomSDKeDotNetWrap::DisableScreenRecord() {
    DWORD pid = GetCurrentProcessId();
    EnumWindows(EnumWindowsCB, pid);
    uint8_t* func_data = (uint8_t*)GetProcAddress(GetModuleHandle(L"user32.dll"), "SetWindowDisplayAffinity");
}

Please let me know what these errors mean and how to resolve them. The errors are: enter image description here

You need to add a reference to the respective library(dll) you're using in the function you're trying to put inside the library.

As seen in your code above you're trying to use standard Windows libraries. Have you tried editing your project properties then linker input options to include user32.lib ?

Thank you everyone who answered. Actually it was just because I was not using user32.lib library in the project when I added the errors got removed and it started working for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM