Page 1 of 1

SOLVED : wxMathPlot compiling on Linux

Posted: Thu Oct 19, 2006 8:23 am
by arwen
I have develop a little application on WxDevC++ on windows in order to learn to use wxwidget.
In this application I use wxMathPlot
http://wxmathplot.sourceforge.net/
and in order to not use wxmathplot like library I
include the mathplot.cpp and mathplot.h in my source .

In windows with wxDev-C++ I don't have any problem but when I try to compile on Linux
with Code::Blocks (or compile the demo source with the make file that came with wxMathPlot) I receive many errors .

The same things appen if I try to make a project in code::bloks that have as source the
mathplot.cpp
mathplot.h
and the demo source of mathplot mp1.cpp

Help , where mistake?
You can download the code that i try to compile here :
http://aria.francesco.googlepages.com/TestPlot.tar.gz
-------------- Build: Debug in TestPlot ---------------
g++ -L/usr/lib -o bin/Debug/TestPlot obj/Debug/mathplot.o obj/Debug/mp1.o `wx-config --libs`
obj/Debug/mathplot.o: In function `mpWindow::OnCenter(wxCommandEvent&)':
/home/franaria/Projects/TestPlot/mathplot.cpp:480: undefined reference to `mpWindow::SetPos(double, double)'
obj/Debug/mathplot.o: In function `mpWindow::OnScroll2(wxScrollWinEvent&)':
/home/franaria/Projects/TestPlot/mathplot.cpp:542: undefined reference to `mpWindow::GetScaleX() const'
/home/franaria/Projects/TestPlot/mathplot.cpp:542: undefined reference to `mpWindow::GetScaleX() const'
/home/franaria/Projects/TestPlot/mathplot.cpp:542: undefined reference to `mpWindow::SetPosX(double)'
/home/franaria/Projects/TestPlot/mathplot.cpp:546: undefined reference to `mpWindow::GetScaleY() const'
/home/franaria/Projects/TestPlot/mathplot.cpp:546: undefined reference to `mpWindow::GetScaleY() const'
/home/franaria/Projects/TestPlot/mathplot.cpp:546: undefined reference to `mpWindow::SetPosY(double)'
obj/Debug/mathplot.o: In function `mpWindow::UpdateAll()':
/home/franaria/Projects/TestPlot/mathplot.cpp:588: undefined reference to `mpWindow::GetScaleX() const'
/home/franaria/Projects/TestPlot/mathplot.cpp:589: undefined reference to `mpWindow::GetScaleY() const'
/home/franaria/Projects/TestPlot/mathplot.cpp:590: undefined reference to `mpWindow::GetPosX() const'
/home/franaria/Projects/TestPlot/mathplot.cpp:590: undefined reference to `mpWindow::GetScaleX() const'
/home/franaria/Projects/TestPlot/mathplot.cpp:591: undefined reference to `mpWindow::GetPosY() const'
/home/franaria/Projects/TestPlot/mathplot.cpp:591: undefined reference to `mpWindow::GetScaleY() const'
obj/Debug/mathplot.o: In function `mpWindow::wxCreateObject()':
/home/franaria/Projects/TestPlot/mathplot.cpp:352: undefined reference to `mpWindow::mpWindow()'
obj/Debug/mathplot.o: In function `~mpWindow':
/home/franaria/Projects/TestPlot/mathplot.cpp:393: undefined reference to `vtable for mpWindow'
/home/franaria/Projects/TestPlot/mathplot.cpp:393: undefined reference to `vtable for mpWindow'
/home/franaria/Projects/TestPlot/mathplot.cpp:393: undefined reference to `vtable for mpWindow'
obj/Debug/mathplot.o: In function `mpWindow':
/home/franaria/Projects/TestPlot/mathplot.cpp:369: undefined reference to `vtable for mpWindow'
/home/franaria/Projects/TestPlot/mathplot.cpp:369: undefined reference to `vtable for mpWindow'
obj/Debug/mathplot.o: In function `mpScaleY::Plot(wxDC&, mpWindow&)':
/home/franaria/Projects/TestPlot/mathplot.cpp:304: undefined reference to `mpWindow::GetPosX() const'
/home/franaria/Projects/TestPlot/mathplot.cpp:304: undefined reference to `mpWindow::GetScaleX() const'
/home/franaria/Projects/TestPlot/mathplot.cpp:305: undefined reference to `mpWindow::GetScrY() const'
/home/franaria/Projects/TestPlot/mathplot.cpp:309: undefined reference to `mpWindow::GetScaleY() const'
/home/franaria/Projects/TestPlot/mathplot.cpp:311: undefined reference to `mpWindow::GetPosY() const'
/home/franaria/Projects/TestPlot/mathplot.cpp:311: undefined reference to `mpWindow::GetScaleY() const'
/home/franaria/Projects/TestPlot/mathplot.cpp:327: undefined reference to `mpWindow::GetPosY() const'
/home/franaria/Projects/TestPlot/mathplot.cpp:327: undefined reference to `mpWindow::GetScaleY() const'
/home/franaria/Projects/TestPlot/mathplot.cpp:332: undefined reference to `mpWindow::GetPosY() const'
/home/franaria/Projects/TestPlot/mathplot.cpp:332: undefined reference to `mpWindow::GetScaleY() const'
obj/Debug/mathplot.o: In function `mpScaleX::Plot(wxDC&, mpWindow&)':
/home/franaria/Projects/TestPlot/mathplot.cpp:246: undefined reference to `mpWindow::GetPosY() const'
/home/franaria/Projects/TestPlot/mathplot.cpp:246: undefined reference to `mpWindow::GetScaleY() const'
/home/franaria/Projects/TestPlot/mathplot.cpp:247: undefined reference to `mpWindow::GetScrX() const'
/home/franaria/Projects/TestPlot/mathplot.cpp:251: undefined reference to `mpWindow::GetScaleX() const'
/home/franaria/Projects/TestPlot/mathplot.cpp:253: undefined reference to `mpWindow::GetPosX() const'
/home/franaria/Projects/TestPlot/mathplot.cpp:253: undefined reference to `mpWindow::GetScaleX() const'
/home/franaria/Projects/TestPlot/mathplot.cpp:269: undefined reference to `mpWindow::GetPosX() const'
/home/franaria/Projects/TestPlot/mathplot.cpp:269: undefined reference to `mpWindow::GetScaleX() const'
/home/franaria/Projects/TestPlot/mathplot.cpp:274: undefined reference to `mpWindow::GetPosX() const'
/home/franaria/Projects/TestPlot/mathplot.cpp:274: undefined reference to `mpWindow::GetScaleX() const'
obj/Debug/mathplot.o: In function `mpFXY::Plot(wxDC&, mpWindow&)':
/home/franaria/Projects/TestPlot/mathplot.cpp:172: undefined reference to `mpWindow::GetPosY() const'
/home/franaria/Projects/TestPlot/mathplot.cpp:172: undefined reference to `mpWindow::GetScaleY() const'
/home/franaria/Projects/TestPlot/mathplot.cpp:172: undefined reference to `mpWindow::GetPosX() const'
/home/franaria/Projects/TestPlot/mathplot.cpp:172: undefined reference to `mpWindow::GetScaleX() const'
/home/franaria/Projects/TestPlot/mathplot.cpp:179: undefined reference to `mpWindow::GetPosX() const'
/home/franaria/Projects/TestPlot/mathplot.cpp:179: undefined reference to `mpWindow::GetScaleX() const'
/home/franaria/Projects/TestPlot/mathplot.cpp:180: undefined reference to `mpWindow::GetPosY() const'
/home/franaria/Projects/TestPlot/mathplot.cpp:180: undefined reference to `mpWindow::GetScaleY() const'
/home/franaria/Projects/TestPlot/mathplot.cpp:194: undefined reference to `mpWindow::GetScrX() const'
/home/franaria/Projects/TestPlot/mathplot.cpp:195: undefined reference to `mpWindow::GetScrY() const'
obj/Debug/mathplot.o: In function `mpFY::Plot(wxDC&, mpWindow&)':
/home/franaria/Projects/TestPlot/mathplot.cpp:117: undefined reference to `mpWindow::GetScrY() const'
Process terminated with status 1 (0 minutes, 1 seconds)
50 errors, 0 warnings
Thanks to ALL

Posted: Fri Oct 20, 2006 9:54 am
by arwen
EUREKA !

I find the solution and now I try to compile my application on LINUX

I can compile and run the example at
aria.francesco.googlepages.com/TestPlot.tar.gz
modifing only the mathplot.h file as blelow
because the difference from a windows & LINUX compiling is there :


//#if defined(__GNUG__) && !defined(__APPLE__)
//#pragma interface "mathplot.h"
//#endif

I rem these 3 lines and i can compile it !!!!!!!

Tank's to all

Posted: Fri Oct 20, 2006 11:03 am
by tiwag
here you can download a project
which builds wxMathPlot as static library
and Testplot which uses it
http://tiwag.googlecode.com/svn/binarie ... stPlot.tgz


builds and runs fine in linux and windows (when using wx-config-win)
http://code.google.com/p/wx-config-win/

brgds

Posted: Mon Oct 23, 2006 12:20 pm
by arwen
At the URL below there is my little program that I develop
with your aid
So THANKS TO ALL


I hope that It can be useful to someone .

:D :D :D

http://aria.francesco.googlepages.com/f ... uacquarius

:D :D :D