IID_PPV_ARGS is not declared when compiling with wineg++

SHORT VERSION:

IID_PPV_ARGS() is not declared with wineg++. Is there a replacement?

LONG VERSION:

I’m trying to make a DX11 GUI with imgui. However, I’m on Linux and I don’t have enough RAM to have a reliable virtual machine running Windows so I’m using wineg++ to compile the code on my system.

imgui provides some examples for different frameworks to create GUIs, which includes DX11 with either SDL2 or WIN32. I tried compiling the SDL2 example but it’s very windows specific with a missing <process.h> header for threading which apparently doesn’t have a fix for POSIX systems, so that was a dead end. That leaves me with the WIN32 example.

When compiling with wineg++ -Iimgui/ -Iimgui/backends/ dx11.cpp -o main, I keep getting this error:

error: ‘IID_PPV_ARGS’ was not declared in this scope

I then included the <combaseapi.h> header according to the MSVC docs for the macro, but the problem still persists. Is there a way to replace this macro?

solved, I changed this:

g_pSwapChain->GetBuffer(0, IID_PPV_ARGS(&pBackBuffer));

to this:

g_pSwapChain->GetBuffer(0, IID_ID3D11Texture2D, reinterpret_cast<void**>(&pBackBuffer));

Leave a Comment