[SOLVED] Errors with "Windows.h"



  • Hello... I included "Windows.h" cus I need it to create some mutex and it gave me errors without even using anything from that header... I ran qmake, cleaned project, rebuild all... And errors are still there...

    bq. C:\Program Files (x86)\Windows Kits\8.0\Include\shared\minwindef.h:159: error: C2371: 'WORD' : redefinition; different basic types

    bq. C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h:5066: error: C2556: 'WORD __readfsword(DWORD)' : overloaded function differs only by return type from 'unsigned short __readfsword(unsigned long)'

    bq. C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h:5066: error: C2371: '__readfsword' : redefinition; different basic types

    bq. C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h:5080: error: C2733: '__writefsword' : second C linkage of overloaded function not allowed

    bq. C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h:5121: error: C2733: '__addfsword' : second C linkage of overloaded function not allowed

    bq. C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h:13802: error: C2034: '<unnamed-tag>::<unnamed-tag>::Reserved' : type of bit field too small for number of bits

    bq. C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h:15867: error: C2034: 'IMPORT_OBJECT_HEADER::Reserved' : type of bit field too small for number of bits

    bq. C:\Program Files (x86)\Windows Kits\8.0\Include\shared\wtypes.h:386: error: C2371: 'LANGID' : redefinition; different basic types

    Qt 5.2.1 for Windows 32-bit (VS 2012, 541 MB)
    On my PC I have installed: Microsoft Visual Studio 2012, Microsoft Visual Studio 2013

    Tested with new application and includes without errors...



  • Strange... I included "Windows.h" before any other Qt header and now it works...

    This does not work...
    @#include <QMainWindow>
    #include <QTcpSocket>
    #include <Windows.h>@

    This works...
    @#include <Windows.h>
    #include <QMainWindow>
    #include <QTcpSocket>@


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.