Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Mingw g++ fails on Win10 with Npcap

Mingw g++ fails on Win10 with Npcap

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 3 Posters 1.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    PavloPonomarov
    wrote on last edited by
    #1

    Hello
    Recently I had to move from win7 to win10. In my project I used WinPcap to catch UDP packets. According to official website WinPcap doesn't support win10, and they advice to use Npcap instead. So I installed Npcap from windows installer and downloaded SDK to use libraries in my project.
    But as soon as I build my project I get following error:

    g++.exe - Application Error
    The application was unable to start correctly (0xc0000142)
    

    Same error, that happened when I tried to build the project with old WinPcap SDK.
    I created a blank project, copied Npcap SDK (WpdPack) into it and as soon as I include Npcap to project

    //w10udptest.pro
    INCLUDEPATH += "C:/path_to_projects/w10udptest/WpdPack/Include"
    LIBS += -L "C:/path_to_projects/w10udptest/WpdPack/Lib" -lwpcap -lPacket
    
    //main.cpp
    #include "pcap.h"
    

    I get same g++ crash. Compile Output windows gives me this

    mingw32-make[1]: *** [Makefile.Debug:66: debug/w10udptest.exe] Error -1073741502
    mingw32-make[1]: Leaving directory 'C:/path_to_projects/build-w10udptest-Desktop_Qt_5_12_1_MinGW_64_bit-Debug'
    mingw32-make: *** [Makefile:38: debug] Error 2
    14:42:44: The process "D:\Programs\Qt\Tools\mingw730_64\bin\mingw32-make.exe" exited with code 2.
    Error while building/deploying project w10udptest (kit: Desktop Qt 5.12.1 MinGW 64-bit)
    When executing step "Make"
    

    I have already read this and this post, but looks like I have a combo..

    aha_1980A 1 Reply Last reply
    0
    • P PavloPonomarov

      Hello
      Recently I had to move from win7 to win10. In my project I used WinPcap to catch UDP packets. According to official website WinPcap doesn't support win10, and they advice to use Npcap instead. So I installed Npcap from windows installer and downloaded SDK to use libraries in my project.
      But as soon as I build my project I get following error:

      g++.exe - Application Error
      The application was unable to start correctly (0xc0000142)
      

      Same error, that happened when I tried to build the project with old WinPcap SDK.
      I created a blank project, copied Npcap SDK (WpdPack) into it and as soon as I include Npcap to project

      //w10udptest.pro
      INCLUDEPATH += "C:/path_to_projects/w10udptest/WpdPack/Include"
      LIBS += -L "C:/path_to_projects/w10udptest/WpdPack/Lib" -lwpcap -lPacket
      
      //main.cpp
      #include "pcap.h"
      

      I get same g++ crash. Compile Output windows gives me this

      mingw32-make[1]: *** [Makefile.Debug:66: debug/w10udptest.exe] Error -1073741502
      mingw32-make[1]: Leaving directory 'C:/path_to_projects/build-w10udptest-Desktop_Qt_5_12_1_MinGW_64_bit-Debug'
      mingw32-make: *** [Makefile:38: debug] Error 2
      14:42:44: The process "D:\Programs\Qt\Tools\mingw730_64\bin\mingw32-make.exe" exited with code 2.
      Error while building/deploying project w10udptest (kit: Desktop Qt 5.12.1 MinGW 64-bit)
      When executing step "Make"
      

      I have already read this and this post, but looks like I have a combo..

      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi @pavloponomarov,

      So you get a compiler crash while compiling?

      • Can you actually build and run a small Qt project without Npcap?
      • Please show a bit more compile output. From the few lines you showed, its impossible to tell where the compiler crashed.

      Regards

      Qt has to stay free or it will die.

      P 1 Reply Last reply
      0
      • aha_1980A aha_1980

        Hi @pavloponomarov,

        So you get a compiler crash while compiling?

        • Can you actually build and run a small Qt project without Npcap?
        • Please show a bit more compile output. From the few lines you showed, its impossible to tell where the compiler crashed.

        Regards

        P Offline
        P Offline
        PavloPonomarov
        wrote on last edited by
        #3

        @aha_1980 said in Mingw g++ fails on Win10 with Npcap:

        Can you actually build and run a small Qt project without Npcap?

        Yes I do. I can even build and run the same test project if I comment the line that includes "pcap.h"

        @aha_1980 said in Mingw g++ fails on Win10 with Npcap:

        Please show a bit more compile output. From the few lines you showed, its impossible to tell where the compiler crashed.

        https://pastebin.com/gmcuuEK1
        That's all I get when I rebuild project

        aha_1980A 1 Reply Last reply
        0
        • P PavloPonomarov

          @aha_1980 said in Mingw g++ fails on Win10 with Npcap:

          Can you actually build and run a small Qt project without Npcap?

          Yes I do. I can even build and run the same test project if I comment the line that includes "pcap.h"

          @aha_1980 said in Mingw g++ fails on Win10 with Npcap:

          Please show a bit more compile output. From the few lines you showed, its impossible to tell where the compiler crashed.

          https://pastebin.com/gmcuuEK1
          That's all I get when I rebuild project

          aha_1980A Offline
          aha_1980A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @pavloponomarov So it seems it is really the linker that crashes.

          Are you sure the provided lib files are compatible to MinGW?

          And you are using MinGW 64 bit, it seems. Therefore you also need a 64bit lib.

          Regards

          Qt has to stay free or it will die.

          P 1 Reply Last reply
          2
          • aha_1980A aha_1980

            @pavloponomarov So it seems it is really the linker that crashes.

            Are you sure the provided lib files are compatible to MinGW?

            And you are using MinGW 64 bit, it seems. Therefore you also need a 64bit lib.

            Regards

            P Offline
            P Offline
            PavloPonomarov
            wrote on last edited by
            #5

            @aha_1980 said in Mingw g++ fails on Win10 with Npcap:

            And you are using MinGW 64 bit, it seems. Therefore you also need a 64bit lib.

            You're right, I use MinGW 64bit and I had to switch to Lib/x64 folder, which also contains Packet.lib and wpcap.lib

            LIBS += -L "C:/path_to_projects/w10udptest/WpdPack/Lib/x64" -lwpcap -lPacket
            

            Sadly, it didn't change anything. Still same g++ error. Compile Output is same, except for changed LIBS path in last command

            I have also tried to switch to 32-bit MinGW (changing LIBS again) and to compile 32-bit version - still no success.

            1 Reply Last reply
            0
            • fcarneyF Offline
              fcarneyF Offline
              fcarney
              wrote on last edited by
              #6

              You most likely need to compile the library from their sources yourself. I looked at their file that had the libs in it. There is no mention of MinGW. So it is most likely the libs are compiled using vc++. You need libs compiled using the MinGW compiler.

              C++ is a perfectly valid school of magic.

              P 1 Reply Last reply
              3
              • fcarneyF fcarney

                You most likely need to compile the library from their sources yourself. I looked at their file that had the libs in it. There is no mention of MinGW. So it is most likely the libs are compiled using vc++. You need libs compiled using the MinGW compiler.

                P Offline
                P Offline
                PavloPonomarov
                wrote on last edited by
                #7

                @fcarney
                Thank you!
                I'm not good at compiling sources in windows, but as workaround I installed MSVC 2017 devkit for Qt and it compiles!
                Works 100 times slower and I can't say if it's Npcap, Win10 or MSVC2017 problem.
                I guess I should switch to QUdpSocket

                1 Reply Last reply
                1

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved