Moving from Visual Studio Express to Netbeans. #include <dwmapi.h> not working

1k views Asked by At

I am moving from Visual Studio Express to Netbeans with MinGW. However I cannot resolve one include:

#include <dwmapi.h>
#pragma comment(lib, "dwmapi.lib")

However the following includes seem to work:

#include <d3d9.h>
#include <d3dx9.h>
#pragma comment(lib, "d3d9.lib")
#pragma comment(lib, "d3dx9.lib")

I had to add the DirectX SDK to the linker and include options of the compiler (-I and -l). However I don't know how to do that with the dwmapi.h because I did not download any other SDK.

Does someone know how to resolve this? Thank you very much in advance.

1

There are 1 answers

1
Ivan Aksamentov - Drop On BEST ANSWER
  • MinGW incudes many modified Win API headers. If you use MinGW w64, check in

    %MINGW_HOME%/x86_64-w64-mingw32/include/
    
  • Otherwise, you can use default headers from windows SDK. But unlikely they will compile. But you can try copy it, edit (remove all Microsoft's adornments macro) and make it work. Here is an include path for Win 8.1 SDK:

    C:\Program Files (x86)\Windows Kits\8.1\Include\um
    

    Charge your file search engine to find yours.

  • Note that MinGW GCC doesn't support linker pragmas:

    #pragma comment(lib, ...
    

    You will need to link all libs in command line options of g++ (in Makefile, scrpt, whatever).