I my QT application I am using some legacy code for sending and receiving UDP packets. If I include both the header files <winsock2.h> and the <qcustomplot.h> I get a ton of Winsock redefinition errors.
I traced down the problem to the statement
# include <QtPrintSupport>
in the qcustomplot.h file. If I comment this statement, the winsock2 redefinitions errors do not occur but then of course I am not able to plot anything.
I am doing the usual stuff of adding printsupport in the .pro file.
It seems that the <QtPrintSupport> might be including <windows.h> or <winsock.h> which can cause errors as mentioned in the following
I am not sure how to resolve this if I include "qcustomplot.h".
Please let me know if anyone has encountered something similar.