Hey guys. I've got some code using the windows packet capture library (winpcap) that works fine when compiled with Visual Studio, but just won't compile with Mingw. After a few tweaks I think I've finally found the root of the problem but can't for the life of me figure out how to fix it. It's when both pcap.h and any STL container class header is included...
The simplest way I found to reproduce the issue I'm having is with the following code...
Compiled withCode:#include <pcap.h> #include <windows.h> #include <stdio.h> int main(int argc, char* pszArgs[]) { printf("Testing"); return 0; }it compiles fine. However adding for example #include <deque> and trying to compile with same arguments results in it going mental and complaining about errors like '::snprintf has not ben declared'. Removing either of theseCode:g++ blah.cpp -o blah.exe -IWpd\Includeand it will compile. Anyone with any ideas/comments? Any thoughts much appreciatedCode:#include <pcap.h> #include <deque>![]()




Reply With Quote