VS2017 uses QCustomPlot third-party inventory problem

Use environment:

VS2017+QT5.12.3+QCustomPlo2.01。

 QCustomPlot is a Qt C++ control for drawing and data visualization, which is easy to use and concise. QCustomPlot provides convenience for displaying real-time data and generating high-quality charts in the application. The download address is as follows:

https://www.qcustomplot.com/index.php/download

image.png

After the download is successful, unzip the compressed package. What we need are the two files qcustomplot.h and qcustomplot.cpp, which can be placed in the header folder and source folder of the QT project respectively.

Ideally, it can be used normally without configuration, but it is often not so smooth. So what problems will you encounter?

1. Compiler error E2512 The parameter of the function test macro must be a simple identifier.

When encountering this problem, locate the specific location through the error list of VS. Generally, there is a problem with this piece of code in qcompilerdetection.h

image.png

We can modify it into the following form and recompile to solve the exception

image.png

2. The solution to an exception occurs in the compilation

image.png

The reason for the exception is the lack of dependencies. Right-click the project and select "Properties"-"Property Configuration"-"Connector"-"Input", and add Qt5PrintSupportd.lib in the "Additional Dependencies".

The above are the most common problems when using QCustomPlo. After solving the exception, you can use QCustomPlo like a Widget .

Guess you like

Origin blog.51cto.com/13492397/2675703