wxFreeChart Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
asadilan
Earned some good credits
Earned some good credits
Posts: 147
Joined: Tue Jul 27, 2010 10:42 pm

wxFreeChart

Post by asadilan » Thu Jun 23, 2011 3:29 pm

Hi All,

i am trying to build freechart and use the feature of date as x Axis.

When i do NMAKE, it gives me a LNK1181:cannot open input file "vcmsw\wxFreeChartDemo_lib_bardemos.obj"

I checked the file dont exist yet.

any ideas?
i am on wxWidget 2.8.11 using Win 7 Pro 64 bit.

Thank you
Asa

ouch67
Earned some good credits
Earned some good credits
Posts: 135
Joined: Sun Mar 23, 2008 12:09 am

Re: wxFreeChart

Post by ouch67 » Thu Jun 23, 2011 3:54 pm

sounds like you forgot to compile it is all. Are you linking it statically or dynamically?

asadilan
Earned some good credits
Earned some good credits
Posts: 147
Joined: Tue Jul 27, 2010 10:42 pm

Re: wxFreeChart

Post by asadilan » Thu Jun 23, 2011 4:39 pm

oo

okay, i thought i have to do nmake first.
i guess i ll have to compile using MSVC and then do nmake after?

the way i am linking it is by specifying what lib to look in MSVC project setting and where to look for it.
(is that what you meant by static?)

Thanx for your help
Asa

ouch67
Earned some good credits
Earned some good credits
Posts: 135
Joined: Sun Mar 23, 2008 12:09 am

Re: wxFreeChart

Post by ouch67 » Thu Jun 23, 2011 5:20 pm

If I recall for msvc .lib files are typically static, and .dll files are dynamic.

Which one you use will depend on how you compile your library. wxFreeChart in this case.

But the directions on how to compile it usually come with the code somewhere. Some even have project files. You will have to look around in the files that came with it.

asadilan
Earned some good credits
Earned some good credits
Posts: 147
Joined: Tue Jul 27, 2010 10:42 pm

Re: wxFreeChart

Post by asadilan » Thu Jun 23, 2011 8:18 pm

i have managed to run the demo.

i assumed then the compilation works fine.

next is to include similar object creation in the demo to my project.

i am in particular interested in time series demo project.
I am trying to display date as the x axis and just a number in y axis.

Code: Select all

time_t times[MAX_POINT];
	wxDateTime dt;
	for (size_t n = 0; n < (size_t)count ; n++) {
		dt.ParseFormat(wxString::Format("%d",xEntry[n]), wxT("%Y%m%d"));
		times[n] = dt.GetTicks();
	}

	// first step: create plot
	XYPlot *plot = new XYPlot();

	TimeSeriesDataset *dataset = new TimeSeriesDataset(yEntry, times, count);

	dataset->SetRenderer(new XYLineRenderer());

	plot->AddDataset(dataset);

	// add left number (for quotes) and bottom date axes
	NumberAxis *leftAxis = new NumberAxis(AXIS_LEFT);
	DateAxis *bottomAxis = new DateAxis(AXIS_BOTTOM);


	bottomAxis->SetVerticalLabelText(true);
	bottomAxis->SetDateFormat(wxT("%d-%m"));

	// add axes to first plot
	plot->AddAxis(leftAxis);
	plot->AddAxis(bottomAxis);

	// link axes and dataset
	plot->LinkDataVerticalAxis(0, 0);
	plot->LinkDataHorizontalAxis(0, 0);

	// and finally create chart
	Chart *chart = new Chart(plot, GetName());
	wxChartPanel *chartPanel = new wxChartPanel(this);
	mGraphSizer->Add(chartPanel,wxSizerFlags(1).Expand());
i have to add TimeSeriesDataSet class to my file.
when trying to build, i have LNK2019:

Code: Select all

: error LNK2019: unresolved external symbol "public: virtual __thiscall DateTimeDataset::~DateTimeDataset(void)" ([email protected]@[email protected]) referenced in function [email protected]@[email protected][email protected]$0
1>xtendergraph.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall XYDataset::~XYDataset(void)" ([email protected]@[email protected]) referenced in function [email protected]@[email protected][email protected]$0
1>xtendergraph.obj : error LNK2019: unresolved external symbol "public: __thiscall DateTimeDataset::DateTimeDataset(void)" ([email protected]@[email protected]) referenced in function "public: __thiscall TimeSeriesDataset::TimeSeriesDataset(double *,__int64 *,unsigned int)" ([email protected]@[email protected][email protected])
1>xtendergraph.obj : error LNK2019: unresolved external symbol "public: __thiscall XYDataset::XYDataset(void)" ([email protected]@[email protected]) referenced in function "public: __thiscall TimeSeriesDataset::TimeSeriesDataset(double *,__int64 *,unsigned int)" ([email protected]@[email protected][email protected])
1>xtendergraph.obj : error LNK2001: unresolved external symbol "protected: virtual bool __thiscall XYDataset::AcceptRenderer(class Renderer *)" ([email protected]@@[email protected]@@Z)
1>xtendergraph.obj : error LNK2001: unresolved external symbol "public: virtual double __thiscall XYDataset::GetMaxY(void)" ([email protected]@@UAENXZ)
1>xtendergraph.obj : error LNK2001: unresolved external symbol "public: virtual double __thiscall XYDataset::GetMinY(void)" ([email protected]@@UAENXZ)
1>xtendergraph.obj : error LNK2001: unresolved external symbol "public: virtual double __thiscall XYDataset::GetMaxX(void)" ([email protected]@@UAENXZ)
1>xtendergraph.obj : error LNK2001: unresolved external symbol "public: virtual double __thiscall XYDataset::GetMinX(void)" ([email protected]@@UAENXZ)
1>xtendergraph.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Dataset::NeedRedraw(class DrawObject *)" ([email protected]@@[email protected]@@Z)
1>xtendergraph.obj : error LNK2019: unresolved external symbol "public: __thiscall XYPlot::XYPlot(void)" ([email protected]@[email protected]) referenced in function "public: bool __thiscall cXtenderGraph::Create(class wxWindow *,int,class wxString const &,class wxPoint const &,class wxSize const &,long)" ([email protected]@@[email protected]@[email protected]@[email protected]@[email protected]@[email protected])
1>xtendergraph.obj : error LNK2019: unresolved external symbol "public: __thiscall wxChartPanel::wxChartPanel(class wxWindow *,int,class Chart *,class wxPoint const &,class wxSize const &)" ([email protected]@[email protected]@@[email protected]@[email protected]@[email protected]@@Z) referenced in function "public: void __thiscall cXtenderGraph::AddGraph(struct sPlotData,int,int)" ([email protected]@@[email protected]@[email protected])
1>xtendergraph.obj : error LNK2019: unresolved external symbol "public: __thiscall Chart::Chart(class Plot *,class wxString const &)" ([email protected]@[email protected]@@[email protected]@@Z) referenced in function "public: void __thiscall cXtenderGraph::AddGraph(struct sPlotData,int,int)" ([email protected]@@[email protected]@[email protected])
1>xtendergraph.obj : error LNK2019: unresolved external symbol "public: void __thiscall AxisPlot::LinkDataHorizontalAxis(unsigned int,unsigned int)" ([email protected]@@[email protected]) referenced in function "public: void __thiscall cXtenderGraph::AddGraph(struct sPlotData,int,int)" ([email protected]@@[email protected]@[email protected])
1>xtendergraph.obj : error LNK2019: unresolved external symbol "public: void __thiscall AxisPlot::LinkDataVerticalAxis(unsigned int,unsigned int)" ([email protected]@@[email protected]) referenced in function "public: void __thiscall cXtenderGraph::AddGraph(struct sPlotData,int,int)" ([email protected]@@[email protected]@[email protected])
1>xtendergraph.obj : error LNK2019: unresolved external symbol "public: void __thiscall AxisPlot::AddAxis(class Axis *)" ([email protected]@@[email protected]@@Z) referenced in function "public: void __thiscall cXtenderGraph::AddGraph(struct sPlotData,int,int)" ([email protected]@@[email protected]@[email protected])
1>xtendergraph.obj : error LNK2019: unresolved external symbol "public: __thiscall DateAxis::DateAxis(enum AXIS_LOCATION)" ([email protected]@[email protected][email protected]@@Z) referenced in function "public: void __thiscall cXtenderGraph::AddGraph(struct sPlotData,int,int)" ([email protected]@@[email protected]@[email protected])
1>xtendergraph.obj : error LNK2019: unresolved external symbol "public: __thiscall NumberAxis::NumberAxis(enum AXIS_LOCATION)" ([email protected]@[email protected][email protected]@@Z) referenced in function "public: void __thiscall cXtenderGraph::AddGraph(struct sPlotData,int,int)" ([email protected]@@[email protected]@[email protected])
1>xtendergraph.obj : error LNK2019: unresolved external symbol "public: void __thiscall AxisPlot::AddDataset(class Dataset *)" ([email protected]@@[email protected]@@Z) referenced in function "public: void __thiscall cXtenderGraph::AddGraph(struct sPlotData,int,int)" ([email protected]@@[email protected]@[email protected])
1>xtendergraph.obj : error LNK2019: unresolved external symbol "public: void __thiscall Dataset::SetRenderer(class Renderer *)" ([email protected]@@[email protected]@@Z) referenced in function "public: void __thiscall cXtenderGraph::AddGraph(struct sPlotData,int,int)" ([email protected]@@[email protected]@[email protected])
1>xtendergraph.obj : error LNK2019: unresolved external symbol "public: __thiscall XYLineRenderer::XYLineRenderer(bool,bool,int,int)" ([email protected]@[email protected][email protected]) referenced in function "public: void __thiscall cXtenderGraph::AddGraph(struct sPlotData,int,int)" ([email protected]@@[email protected]@[email protected])
1>xtendergraph.obj : error LNK2001: unresolved external symbol "public: static class wxClassInfo XYDataset::ms_classInfo" ([email protected]@@[email protected]@A)
the above error suggest that i dont have the listed functions, which are from XYDataset and DAteTimeDataset.
Below is my include files list
#include <wx/xy/xyplot.h>
#include <wx/xy/xylinerenderer.h>
#include <wx/xy/xysimpledataset.h>
#include <wx/xy/xydataset.h>

#include <wx/chart.h>
#include <wx/chartpanel.h>
#include <wx/axis/numberaxis.h>
#include <wx/axis/dateaxis.h>
#include <democollection.h>
#include <wx/dataset.h>

Is there anything that i am missing here?
i dont think i should define the missing function do i?

Thanx
Asa

ouch67
Earned some good credits
Earned some good credits
Posts: 135
Joined: Sun Mar 23, 2008 12:09 am

Re: wxFreeChart

Post by ouch67 » Thu Jun 23, 2011 9:26 pm

Well it's saying it can't find the library that you compiled.

You have to link the library to your project. How you do that in MSVC I don't know for sure, I haven't used msvc since the old 6.0.

But you should see other libraries like other wxWidgets stuff mentioned in the list when you find it. just add the library you compiled to that list, and make sure your search directories are set up to find it.

asadilan
Earned some good credits
Earned some good credits
Posts: 147
Joined: Tue Jul 27, 2010 10:42 pm

Re: wxFreeChart

Post by asadilan » Thu Jun 23, 2011 9:42 pm

thanx..
got it...

Post Reply