Problem to compile with MinGW + Qt 4 + winpcap
Hello,
I want to use winpcap on Qt 4 program, but I have compilation errors if I include pcap header files with Qt headers. Here's an little example :
main.cpp
Code:
#include <pcap.h>
#include <remote-ext.h>
#include <QApplication>
#include <QDialog>
int main(int argc, char ** argv)
{
window->show();
return app.exec();
}
and project file
Code:
SOURCES = main.cpp
win32:LIBS += -LC:\WpdPack\Lib -lwpcap
win32:INCLUDEPATH += C:\WpdPack\include
With Visual studio no errors. With minGW :
Code:
from C:/Qt/4.1.1-gw/include/QtGui/qapplication.h:1,
from main.cpp:4:
C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits
/c++locale.h: In function `int std::__convert_from_v(char*, int, const char*, _T
v, int* const&, int)':
C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits
/c++locale.h:68: error: `snprintf' is not a member of `std'
mingw32-make[1]: *** [release\main.o] Error 1
mingw32-make[1]: Leaving directory `C:/Documents and Settings/jl/Mes documents/e
ssaigcc'
mingw32-make: *** [release] Error 2
It's the last lines of errors compilation.
If I delete pcap headers, no error. If I delete Qt code and headers, no error !
Thanks for help
Re: Problem to compile with MinGW + Qt 4 + winpcap
Try:
Code:
#include <QApplication>
#include <QDialog>
#include <pcap.h>
#include <remote-ext.h>
int main(int argc, char ** argv)
{
...
}
Re: Problem to compile with MinGW + Qt 4 + winpcap
Thanks you very much ! It's good
do you have an explanation?
Re: Problem to compile with MinGW + Qt 4 + winpcap
Quote:
Originally Posted by jlbrd
do you have an explanation?
Unfortunately not, I've just run into similar problem when I tried to use STL in my application.
Re: Problem to compile with MinGW + Qt 4 + winpcap