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. How to add winpcap to QT proj
Qt 6.11 is out! See what's new in the release blog

How to add winpcap to QT proj

Scheduled Pinned Locked Moved General and Desktop
6 Posts 4 Posters 7.7k Views 1 Watching
  • 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.
  • I Offline
    I Offline
    Ivan Filko
    wrote on last edited by
    #1

    Hi, I am writing an application that works with WinPcap. Problem with the addition of the library. I have download winpcap.exe and wdkpack.
    Make this:
    INCLUDEPATH += C:\Program Files\WinPcap\WpdPack\Include
    LIBS += C:\Program Files\WinPcap\WpdPack\Lib -lwpcap - lpacket

    but it gave me mistace, that "can't find file"...

    #include "pcap.h" - dosen't work =(

    I have low level of knowlege in QT, please help me add this lib.

    P.S. Please give a detailed explanation

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Code_ReaQtor
      wrote on last edited by
      #2

      The problem is the "space" between "Program Files".

      I can't recall any links on that matter, but I think it still exists here on this forum.

      EDIT: "Here":http://qt-project.org/doc/qt-4.8/qmake-project-files.html#whitespace it is! Hope it helps.

      Please visit my open-source projects at https://github.com/Code-ReaQtor.

      1 Reply Last reply
      0
      • K Offline
        K Offline
        koahnig
        wrote on last edited by
        #3

        welcome to devnet

        You should change the separator of your path to a forward slash ('/') instead of the backslash ('').
        @
        INCLUDEPATH += "C:/Program Files/WinPcap/WpdPack/Include"
        LIBS += "C:/Program Files/WinPcap/WpdPack/Lib" -lwpcap – lpacket
        @

        The backslash is used as line continuation indicator. Windows understands both anyway and it is common practice with Qt to use always the forward slash.

        I think you need also the quotation marks.

        Vote the answer(s) that helped you to solve your issue(s)

        1 Reply Last reply
        0
        • I Offline
          I Offline
          Ivan Filko
          wrote on last edited by
          #4

          Thanks, but it did not help.
          [quote author="koahnig" date="1366540475"]welcome to devnet

          You should change the separator of your path to a forward slash ('/') instead of the backslash ('').
          @
          INCLUDEPATH += "C:/Program Files/WinPcap/WpdPack/Include"
          LIBS += "C:/Program Files/WinPcap/WpdPack/Lib" -lwpcap – lpacket
          @

          The backslash is used as line continuation indicator. Windows understands both anyway and it is common practice with Qt to use always the forward slash.

          I think you need also the quotation marks. [/quote]

          1 Reply Last reply
          0
          • I Offline
            I Offline
            Ivan Filko
            wrote on last edited by
            #5

            Thanks, it work!!!
            [quote author="koahnig" date="1366540475"]welcome to devnet

            You should change the separator of your path to a forward slash ('/') instead of the backslash ('').
            @
            INCLUDEPATH += "C:/Program Files/WinPcap/WpdPack/Include"
            LIBS += "C:/Program Files/WinPcap/WpdPack/Lib" -lwpcap – lpacket
            @

            The backslash is used as line continuation indicator. Windows understands both anyway and it is common practice with Qt to use always the forward slash.

            I think you need also the quotation marks. [/quote]

            1 Reply Last reply
            0
            • G Offline
              G Offline
              gilgil
              wrote on last edited by
              #6

              I hope it will help you.

              @
              WINPCAP_PATH = $$PWD/../../winpcap
              INCLUDEPATH += $${WINPCAP_PATH}/Include
              win32:contains(QMAKE_TARGET.arch, x86_64) {
              LIBS += -L$${WINPCAP_PATH}/Lib/x64
              } else {
              LIBS += -L$${WINPCAP_PATH}/Lib
              }
              @

              1 Reply Last reply
              0

              • Login

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