QCustomPlot Discussion and Comments

How to use QCutomPlot library on linux environment ?Return to overview

Actually I am newbee in Qt world.In my current project I am using Qt 4.7.4 on RHEL 6.Please somebody tell me how to make .so lib from QCustomPlot source code.

Have a look at general tutorials about compiling static libraries with Qt. QCustomPlot is not different here. In fact, makes it very easy in its amalgamated two-file-form.

For example, look at this tutorial:
http://qt-project.org/wiki/How_to_create_a_library_with_Qt_and_use_it_in_an_application
(scroll down a bit to the Creating a static library part.)

I am getting below errors when the project is build.

Problem Window shows below Errors:
-----------------------------------------------
Description Resource Path Location Type
from definition of ‘template<class T> class QtCppIntegration::QTypeInfo’ plot-examples line 1967, external location: /usr/local/Trolltech/Qt-4.7.4/include/QtCore/qglobal.h C/C++ Problem
make: *** [debug] Error 2 plot-examples line 0 C/C++ Problem
make[1]: *** [debug/main.o] Error 1 plot-examples line 0 C/C++ Problem
specialization of ‘template<class T> class QtCppIntegration::QTypeInfo’ in different namespace plot-examples line 1701, external location: ../../qcustomplot.h C/C++ Problem
specialization of ‘template<class T> class QtCppIntegration::QTypeInfo’ in different namespace plot-examples line 1864, external location: ../../qcustomplot.h C/C++ Problem
specialization of ‘template<class T> class QtCppIntegration::QTypeInfo’ in different namespace plot-examples line 1961, external location: ../../qcustomplot.h C/C++ Problem
specialization of ‘template<class T> class QtCppIntegration::QTypeInfo’ in different namespace plot-examples line 315, external location: ../../qcustomplot.h C/C++ Problem
specialization of ‘template<class T> class QtCppIntegration::QTypeInfo’ in different namespace plot-examples line 493, external location: ../../qcustomplot.h C/C++ Problem
specialization of ‘template<class T> class QtCppIntegration::QTypeInfo’ in different namespace plot-examples line 813, external location: ../../qcustomplot.h C/C++ Problem

--------------------------------------------------
Please help me to solve these issues.

Please provide some more info on the context. So which toolchain you are using, what you did to start the build process, what project you used, etc.

Environment:
Toolchain: gcc version 4.4.4
OS: RHEL 6
QT: 4.7.4
Workbench: eclipse

I have downloaded QCustomPlot folder from http://www.qcustomplot.com.

-->QCustomPlot folder copied in home folder.
-->On Qt4.7.4 Eclipse Workbench I have imported Qt Project from "/home/QCustomPlot/examples/plots/plots-examples.pro".
-->after project imported on workspace then I have done right click and done "clean project" which inturn does Build. After build it has given errors which i have mentioned previously.

I've just tested QCP on RHEL6 (actually CentOS, but it's the same) and it works without trouble.

Go into the plot-examples directory and execute
qmake
or qmake-qt4
depending on your setup.
Then execute make

If this also throws the errors there is something wrong with your Qt installation. Did you compile it yourself? In my RHEL test I've used the qt4-devel package (Qt 4.6.2) from the repository.

On the other hand, if compiling from the terminal works, the problem is something in your eclipse configuration. As far as I know, Nokia/Digia has abandoned the Qt eclipse integration with CDT years ago.

It is working with qmake-qt4
(It has given errors with qmake)
then i have given make
and then run(./plot-examples).

Its working perfectly.

Thank you for help.