User forums > Using Code::Blocks
SOLVED wxMathPlot compiling on Linux with Code::Blocks
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 I receive many errors .
Help , where mistake?
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
Below some errors that I receive
--- Quote ---:: === TestPlot, Debug ===
/home/franaria/Projects/TestPlot/mathplot.cpp:480: undefined reference to `mpWindow::SetPos(double, double)'
/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'
..................
..................
..................
:: More errors follow but not being shown.
:: Edit the max errors limit in compiler options...
:: === Build finished: 50 errors, 0 warnings ===
--- End quote ---
How I can resolve?
I know that this is not a programming section but I do not know where to blink my head.
Therefore I ask excuse
Thanks to All
Pecan:
//-- Full Compile Logging --
Main Menu->Settings->Compiler and Debugger->"Other"->Compiler logging = "Full command line".
Could you turn on command line logging and paste the results here or attach a zip file. You can copy the log via right-mouse-select-all/copy
Also check "Project Build Options" linker and includes to make sure the correct libraries are specified.
arwen:
Thanks Pecan !! :D
Here you can download the little test code that I can't compile aria.francesco.googlepages.com/TestPlot.tar.gz
Below there is the Build log
--- Quote ----------------- 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
--- End quote ---
tiwag:
i guess, your problem is, that wx-config isn't installed on your linux computer,
or you don't have it in your path
--- Quote ----------------- Build: Debug in TestPlot ---------------
g++ -L/usr/lib -o bin/Debug/TestPlot obj/Debug/mathplot.o obj/Debug/mp1.o `wx-config --libs`
--- End quote ---
`wx-config --libs` should expand to the wx libraries
the erros are coming, because g++ can't find the necessary libraries
brgds, tiwag
eranif:
The problem can be what tiwag mentioned, to eliminate this option, try to run wx-config (or type 'which wx-config')
If wx-config exist under your Linux, try this:
1. try to replace in your makefile, `wx-config --libs` with $(shell wx-config --libs), I saw some versions of makefiles that do not expand command line properly and needed this 'shell' command to help them out.
2. If I am not mistaken, wx-config accepts another parameters after the '--libs' flags, for example: "--debug=yes --unicode=no". but I can be wrong on this one and it has default parameters ( I dont have my Linux box infront of me, so cant really say)
EDIT:
If `wx-config` does not exist, how did you get to the link part? Why didnt you fail in compile, which also uses `wx-config --cflags`?
HTH,
Eran
Navigation
[0] Message Index
[#] Next page
Go to full version