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:

    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: Imgur: The magic of the Internet

You may get compiler error if you use a C++ Compiler to build a C# program. They are two distinct languages. Please update your language tags with the one language you are using

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 ?
Source: c# - I am getting C++ compilation issues while compiling my project - Stack Overflow

can you please let me know about to add as I am not a C++ expert?

did you try user32.lib directory in the project or not?

Hi @umarakmal56j,

Check my answer in another post, link provided below.

This will help to clear the C++ compilation issues…

Hope this helps…


1 Like

thanks Appreciated your efforts, one member asked the question and lot of people has solved their queries.

It’s always great to see collaboration on the dev forum!

Unfortunately since this topic is not directly related to SDK usage, I am going to close it out. If anyone has additional questions regarding the Meeting SDK, please create a new topic. For any general programming questions, we recommend checking out the language documentation or a more generally-oriented site, such as StackOverflow. :slightly_smiling_face: