QT Installation problem

  • I have been developing an application on Mac and Windows for some time. I have been developing updates on Mac for the past few months. I compiled the application on my Win7 installation (virtual machine running through Parallels) and got the following error:

    C:\Qt\Tools\mingw530_32\i686-w64-mingw32\include\iphlpapi.h:38: error: 'PMIB_TCPTABLE2' was not declared in this scope
       ULONG WINAPI GetTcpTable2 (PMIB_TCPTABLE2 TcpTable, PULONG SizePointer, WINBOOL Order);

    This is a MinGW source file which I haven't touched. I figured my installation got corrupted so I uninstalled QT entirely and re-installed it. However, I still get the same error.

    PMIB_TCPTABLE2 is declared in include\tcpmib.h inside the the precompiled define

    #if (_WIN32_WINNT >= 0x0600)
    ...PMIB_TCPTABLE2 definition...

    I put poor syntax inside the #if and no error was generated so it seems that _WIN32_WINNT is < 0x0600. My target is Desktop PC, I want Win7 & Win10 support.

    Any ideas on what could be wrong in my set up? I did upgrade parallels recently but not the windows image, which I have used in the past for this purpose.

  • Lifetime Qt Champion

    @mgreenish What exact Qt version do you use?

  • Hi, MinGW sets _WIN32_WINNT to 0x0502 (Windows 2003 Server and later) in it's header file _mingw.h. (Means a hello world.c compiled with MinGW should be able to run on Windows 2003 Server and later.)

    PMIB_TCPTABLE2 perhaps does not work on Windows Server 2003, could be the reason for #if (_WIN32_WINNT >= 0x0600) i.e. requires Vista or later.

    Try #define _WIN32_WINNT 0x0600 at the top of your program, then MinGW will not change it.

  • @jsulm QT Creator Community 4.11.1 & MinGW 5.3

  • @hskoglund said in QT Installation problem:

    _WIN32_WINNT 0x0600

    Good idea. I set the following at the top of my main:

    #ifdef Q_OS_WIN
    #define _WIN32_WINNT 0x0600

    But that didn't work. But I found the definition for _WIN32_WINNT in include_mingw.h and changed it from 0x502 to 0x600 and that worked.

    Just odd that I have never run into that in the past...

    Thanks for clarifying what the default means !!

  • Lifetime Qt Champion

    @mgreenish said in QT Installation problem:

    QT Creator Community 4.11.1

    Just as note: this is QtCreator version not Qt. They are not the same.

  • @jsulm Right, sorry, 5.9.9. Before I uninstalled it, I had 5.8.0.

Log in to reply