'C++ winapi32 chart
I would like to create a chart with this tool: http://www.codecutter.net/tools/koolplot/
I use eclipse + minGW
I installed the koolplot, in this way:
Library installation for MingW:
Copy headers koolplot.h, Plotdata.h, Plotstream.h, winbgitypes.h and BGI_util.h To your MingW #include directory.
Copy library libkoolplot.a to your MingW lib directory.
But first of all I had to modify the graphics.h file, after that I get this error:
g++ -mwindows -o aplot.exe -lkoolplot -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32 -lstdc++ -lsupc++ -o plot.exe "src\\plot.o"
src\plot.o: In function `main':
...workspace\plot\Debug/../src/plot.cpp:5: undefined reference to `Plotdata::Plotdata(double, double)'
...plot\Debug/../src/plot.cpp:5: undefined reference to `operator*(double, Plotdata const&)'
...plot\Debug/../src/plot.cpp:5: undefined reference to `sin(Plotdata const&)'
...plot\Debug/../src/plot.cpp:5: undefined reference to `Plotdata::operator-(Plotdata const&) const'
...plot\Debug/../src/plot.cpp:6: undefined reference to `plot(Plotdata const&, Plotdata const&)'
collect2: ld returned 1 exit status
Here is my code:
#include "koolplot.h"
int main()
{
plotdata x(-6.0, 6.0);
plotdata y = sin(x) + x/5;
plot(x, y);
return 0;
}
Any idea whats wrong? Or could anybody send me another good (easy to use) tool to create charts?
Solution 1:[1]
First of all, never install any 3rd party libraries the way you just did. MinGW is a standalone toolchain and has to always stay virgin (untouched). You should have created a specific directory somewhere on your machine, lets say koolplot. Then create two more directories inside it include and lib. Then put headers in include and libraries in lib.
The next thing you should do is to add a path to includes and a path to libraries (the ones we've just created) for your project in Eclipse. Look carefully in the configuration of your project, there are special options dedicated to that.
If that still does not work, then I'll need more information:
- With which compiler
koolplotwas built and what was a target platform? - What is the target platform of your current MinGW distribution as well?
NOTE: If you want to develop contemporary, good-looking, and cross-platform application, utilizing all the power of C++ object-oriented approach, then I'd highly recommend you to dive into Qt. Yes, it contains widgets for charts, graphs, and much more stuff that you are probably even not aware of yet, but will surely need as your application grows.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
