Hi all,
I've downloaded and installed "qt-sdk-win-opensource-2009.01.1" with Qtcreator on windows xp.I'm new to Qt and I'm trying to build an application that uses winpcap but have encountered some issues that needs advice.
1) After installation I've manually set the environment variables for PATH,QTDIR and QMAKESPEC as mine does not show these 3 variables after installation. I've created a Qt4 GUI application project and added the following to .pro file and main.cpp:
my .pro file looks like:
while my main.cpp looks like:Qt Code:
TARGET = HelloQtGUI TEMPLATE = app SOURCES += main.cpp\ helloqtgui.cpp HEADERS += helloqtgui.h FORMS += helloqtgui.ui win32:LIBS += -Ld:/proj/WpdPack402/Lib -lwpcap win32:INCLUDEPATH += d:/proj/WpdPack402/IncludeTo copy to clipboard, switch view to plain text mode
However,when I hit Ctrl+R to run it i get the following application output message and the blank GUI main window does not pop up:#include <QtGui/QApplication>
#include "helloqtgui.h"
#include <pcap.h>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
HelloQtGUI w;
w.show();
//Testing portion of code
char *dev,errbuf[PCAP_ERRBUF_SIZE];
//Retrieve the device list from the local machine
dev = pcap_lookupdev(errbuf);
if (dev == NULL)
{
fprintf(stderr, "Couldn't find default device: %s\n", errbuf);
return(2);
}
printf("Device: %s\n", dev);
return a.exec();
}
I tried to run the executable in debug folder but an error with "The application has failed to start because wpcap.dll was not found.Re-installing the application may fix this problem".There seems to be no compilation issues.If I were to remove the "Testing portion" of winpcap code then it works fine.Starting D:/proj/HelloQtGUI/debug/HelloQtGUI.exe...
D:/proj/HelloQtGUI/debug/HelloQtGUI.exe exited with code -1073741515
Then I removed the environment variables (since initially installation does not add them) and rerun my application but now I get this message when I tried to run my executable:
"The application has failed to start because mingwm10.dll was not found.Re-installing the application may fix this problem".
Is there any solution for this??
2) If my application uses winpcap libraries and required to be able to run on different versions of windows like xp and vista,which deployment will be more appropriate to use,static or shared libraries?Perhaps can someone provide me a clearer picture of this?
Thanks in advance.Appreciate any help.
Bookmarks