How to add winpcap to QT proj
-
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 - lpacketbut 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
-
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.
-
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.
-
Thanks, but it did not help.
[quote author="koahnig" date="1366540475"]welcome to devnetYou 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]
-
Thanks, it work!!!
[quote author="koahnig" date="1366540475"]welcome to devnetYou 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]
-
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
}
@