QCustomPlot Discussion and Comments

Ton of compile errors just after adding qcustomplot.hReturn to overview

I've been using this library since almost a year in the same project and I've included it on my qmdisubwindows classes. No problem at all.
Now I'd want to create in a different class a QSharedPointer< QCPGraphDataContainer > which could be used by all graphs in the project sharing the same data...
Just including qcustomplot.h in this new file - no qcustomplot classes have still been used - I get a ton of errors:

C:\Program Files (x86)\Windows Kits\8.1\Include\um\winnt.h:16527: error: C2059: syntax error : 'constant'
C:\Program Files (x86)\Windows Kits\8.1\Include\um\winnt.h:16527: error: C2334: unexpected token(s) preceding ':'; skipping apparent function body
C:\Program Files (x86)\Windows Kits\8.1\Include\um\winnt.h:19108: error: C2059: syntax error : 'string'
C:\Program Files (x86)\Windows Kits\8.1\Include\um\winnt.h:19108: error: C2334: unexpected token(s) preceding '{'; skipping apparent function body
C:\Program Files (x86)\Windows Kits\8.1\Include\shared\minwindef.h:186: error: C2159: more than one storage class specified

and so on

What's happening? Why including it here it behaves that way?

in myclass.h I include:

#include <QObject>
#include <QVector>
#include <QList>
#include <QMap>
#include <QThread>
#include <QTcpSocket>
#include <QMutex>
#include <QWaitCondition>
#include "qcustomplot.h"

and other project files

in myclass.cpp I include:

#include <QDebug>
#include "datamanager.h"
#include <assert.h>
#include <QDir>
#include <memory>
#include <QDebug>
#include <QTcpSocket>
#include <QAbstractSocket>
#include <chrono>

more details: if I include it in .cpp file I don't get such errors but then I can't declare QSharedPointer< QCPGraphDataContainer > variables in .h file

When you google for the errors it seems that this winnt.h header causes a lot of problems. Where do you include it? did you make sure to include <windows.h> before it?

I don't include it explicitly. It's included by qt themselves probably

no one has an idea?

It's still a bad issue for me. I'm considering qt library version I'm using is incompatible with this qcustomplot version:

I'm using qt 5.7 msvc 2013 64 bit,
qcustomplot : version 2.0.1 date 25.06.18

solved: nothing concerning with this library. it was a symbol defined with #define in another file which conflicted with a microsoft's file

I've the same problem, what are the 2 file with the same simbol defined?

The same problem in my project

I've solve the problem in the following way: commented out line
# include <QtPrintSupport/QtPrintSupport> in the qcustomplot.h
and function savePdf(...) in header and sourse files

Probably the reason was in QtPrintSupport