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. libpcap help

libpcap help

Scheduled Pinned Locked Moved Unsolved General and Desktop
10 Posts 4 Posters 690 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
    Pordo
    wrote on last edited by
    #1

    hello, I am trying to install the pcap library in Qt but I am having problems. Try to add the path with

    INCLUDEPATH += C:\Users\Usuario\Desktop\Lucas Pordomingo\recibir_paquete\libpcap-1.10.1

    but I get the error: :-1: error: cannot find -lpcap

    I don't know how to fix this. This is the version of Npcap 1.10.1 I used:
    https://npcap.com/vs-winpcap.html

    JonBJ 1 Reply Last reply
    0
    • P Pordo

      hello, I am trying to install the pcap library in Qt but I am having problems. Try to add the path with

      INCLUDEPATH += C:\Users\Usuario\Desktop\Lucas Pordomingo\recibir_paquete\libpcap-1.10.1

      but I get the error: :-1: error: cannot find -lpcap

      I don't know how to fix this. This is the version of Npcap 1.10.1 I used:
      https://npcap.com/vs-winpcap.html

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @Pordo
      You have changed INCLUDEPATH, which is for searching for #include .h files. Your error is for the -lpcap argument to the linker. You need to do something about adding that path to the LIBS variable.

      1 Reply Last reply
      0
      • P Offline
        P Offline
        Pordo
        wrote on last edited by Pordo
        #3

        I put this:
        INCLUDEPATH += C:\Users\lucas\Desktop\Nueva carpeta\recibir_paquete\WpdPack\Include
        LIBS += "-LC:\Users\lucas\Desktop\Nueva carpeta\recibir_paquete\WpdPack\Lib" -lwpcap -lpacket
        LIBS += -lws2_32

        DEFINES += WPCAP
        DEFINES += HAVE_REMOTE

        and then:
        #include <pcap.h>

        but I hace the error:

        C:\Users\lucas\Desktop\Nueva carpeta\recibir_paquete\main.cpp:18: error: pcap.h: No such file or directory
        ..\recibir_paquete\main.cpp:18:10: fatal error: pcap.h: No such file or directory

        but...the file pcap.h is in this path
        INCLUDEPATH += C:\Users\lucas\Desktop\Nueva carpeta\recibir_paquete\WpdPack\Include

        JonBJ 1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          Did you forgot to quote the path that contains spaces ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          2
          • P Pordo

            I put this:
            INCLUDEPATH += C:\Users\lucas\Desktop\Nueva carpeta\recibir_paquete\WpdPack\Include
            LIBS += "-LC:\Users\lucas\Desktop\Nueva carpeta\recibir_paquete\WpdPack\Lib" -lwpcap -lpacket
            LIBS += -lws2_32

            DEFINES += WPCAP
            DEFINES += HAVE_REMOTE

            and then:
            #include <pcap.h>

            but I hace the error:

            C:\Users\lucas\Desktop\Nueva carpeta\recibir_paquete\main.cpp:18: error: pcap.h: No such file or directory
            ..\recibir_paquete\main.cpp:18:10: fatal error: pcap.h: No such file or directory

            but...the file pcap.h is in this path
            INCLUDEPATH += C:\Users\lucas\Desktop\Nueva carpeta\recibir_paquete\WpdPack\Include

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by JonB
            #5

            @Pordo
            As @SGaist has written: you correctly quote the path with a space in the LIBS line but not in the INCLUDEPATH line. I did not notice that in your first post.

            1 Reply Last reply
            0
            • P Offline
              P Offline
              Pordo
              wrote on last edited by
              #6

              I do not know what you mean with that exactly, the folder moved it from place but I still have the same error, now I have it in :

              INCLUDEPATH += C:\Users\lucas\Desktop\paquetes\WpdPack\Include
              LIBS += "-LC:\Users\lucas\Desktop\paquetes\WpdPack\Lib"-lwpcap -lpacket
              LIBS += -lws2_32

              DEFINES += WPCAP
              DEFINES += HAVE_REMOTE

              I do not know what is the quote I have to put

              JonBJ 1 Reply Last reply
              0
              • P Pordo

                I do not know what you mean with that exactly, the folder moved it from place but I still have the same error, now I have it in :

                INCLUDEPATH += C:\Users\lucas\Desktop\paquetes\WpdPack\Include
                LIBS += "-LC:\Users\lucas\Desktop\paquetes\WpdPack\Lib"-lwpcap -lpacket
                LIBS += -lws2_32

                DEFINES += WPCAP
                DEFINES += HAVE_REMOTE

                I do not know what is the quote I have to put

                JonBJ Offline
                JonBJ Offline
                JonB
                wrote on last edited by JonB
                #7

                @Pordo

                but I still have the same error

                Now that you have removed space from the path (and hence quoting is not an issue) I do not believe you are receiving the same error message, so show what it is now.

                1 Reply Last reply
                0
                • P Offline
                  P Offline
                  Pordo
                  wrote on last edited by
                  #8

                  It show me this error:

                  C:\Users\lucas\Desktop\paquete\main.cpp:16: error: pcap.h: No such file or directory
                  ....\paquete\main.cpp:16:10: fatal error: pcap.h: No such file or directory
                  16 | #include <pcap.h>
                  | ^~~~~~~~

                  Im using the Qt 6.3.1 MinGW 64-bit version, and for pcap the version Winpacp 4.1.2 I don't know if it has something to do with it

                  JonBJ 1 Reply Last reply
                  0
                  • JoeCFDJ Offline
                    JoeCFDJ Offline
                    JoeCFD
                    wrote on last edited by
                    #9

                    Open your Makefile in the build dir and post this line here
                    INCPATH =

                    1 Reply Last reply
                    0
                    • P Pordo

                      It show me this error:

                      C:\Users\lucas\Desktop\paquete\main.cpp:16: error: pcap.h: No such file or directory
                      ....\paquete\main.cpp:16:10: fatal error: pcap.h: No such file or directory
                      16 | #include <pcap.h>
                      | ^~~~~~~~

                      Im using the Qt 6.3.1 MinGW 64-bit version, and for pcap the version Winpacp 4.1.2 I don't know if it has something to do with it

                      JonBJ Offline
                      JonBJ Offline
                      JonB
                      wrote on last edited by JonB
                      #10

                      @Pordo

                      INCLUDEPATH += C:\Users\lucas\Desktop\paquetes\WpdPack\Include

                      C:\Users\lucas\Desktop\paquete\main.cpp:16: error: pcap.h: No such file or directory

                      How are these related? What is the full path to your pcap.h file?

                      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