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
Qt Code:
  1. #include <pcap.h>
  2. #include <remote-ext.h>
  3.  
  4. #include <QApplication>
  5. #include <QDialog>
  6.  
  7. int main(int argc, char ** argv)
  8. {
  9. QApplication app(argc, argv);
  10. QDialog *window = new QDialog;
  11.  
  12. window->show();
  13. return app.exec();
  14. }
To copy to clipboard, switch view to plain text mode 
and project file
Qt Code:
  1. SOURCES = main.cpp
  2. win32:LIBS += -LC:\WpdPack\Lib -lwpcap
  3. win32:INCLUDEPATH += C:\WpdPack\include
To copy to clipboard, switch view to plain text mode 
With Visual studio no errors. With minGW :
Qt Code:
  1. from C:/Qt/4.1.1-gw/include/QtGui/qapplication.h:1,
  2. from C:/Qt/4.1.1-gw/include/QtGui/QApplication:1,
  3. from main.cpp:4:
  4. C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits
  5. /c++locale.h: In function `int std::__convert_from_v(char*, int, const char*, _T
  6. v, int* const&, int)':
  7. C:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.2/mingw32/bits
  8. /c++locale.h:68: error: `snprintf' is not a member of `std'
  9. mingw32-make[1]: *** [release\main.o] Error 1
  10. mingw32-make[1]: Leaving directory `C:/Documents and Settings/jl/Mes documents/e
  11. ssaigcc'
  12. mingw32-make: *** [release] Error 2
To copy to clipboard, switch view to plain text mode 
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