Important: Please read the Qt Code of Conduct -

Problem with windows.h and DWORD type

  • Hello,
    I'm new to Qt, and I need to use DWORD type for a project.
    To start I have added this line in my .pro : (this path corresponds to where the windows.h file is located)
    And I have included windows.h in my header file

    But I still get this error in my header file (and in my source file) unknown type name DWORD :

    If someone can help me pls

  • Moderators

    Hi @Damalo_02

    let me ask a few questions.

    1. Are you actually also using the mingw compiler kit for your application?
      Because there will be conflicts if you add the mingw windows.h to your include path and you're using MSVC compiler.

    2. you shouldn't need to add the include path to simply use windows.h. that should be done automatically. So why did you do it

    3. You have to do a complete rebuild of your project, when you change anything in your *pro file. -> Delete your build folder.

    Edit: fixed format

  • Yes I use mingw as compiler.

    Thanks a lot for your help, I solved the problem. I just installed Visual Studio 2017, created a new Qt project, and everything works fine now.

Log in to reply