Author Topic: wxPlotWindow problems  (Read 7402 times)

elettronica67

  • Guest
wxPlotWindow problems
« on: February 18, 2008, 10:49:05 pm »
Hi to all,

I am new of this forum, and I have a problem using the wxPlotWindow class.

When I write:

wxPlotWindow *m_plot;
m_plot = new wxPlotWindow( this, wxID_ANY, wxPoint(0,0), wxSize(100,100), wxSUNKEN_BORDER | wxPLOT_DEFAULT );

the linker generates the following error message:

undefined reference to `_imp___ZN12wxPlotWindowC1EP8wxWindowiRK7wxPointRK6wxSizei'

I have compiled the sample code contained in the wx-widgets sources about the plot feature (importing the codeblocks project) an on this sample all seems to run well. I have included the same libraries on my project and it does'nt work.
I have done a lot of tests but always I have the linker error.

Can someone help me?

Thanks in advance.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: wxPlotWindow problems
« Reply #1 on: February 18, 2008, 10:59:09 pm »
Link to the library that contains wxPlotWindow.

Edit: I think the library is called wxmsw28u_plot.

To help you please post the "Build Log" after turning in Full Compiler Log. See link on how to change logging.
http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F

Tim S
« Last Edit: February 19, 2008, 12:23:08 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

elettronica67

  • Guest
Re: wxPlotWindow problems
« Reply #2 on: February 19, 2008, 09:02:24 pm »
Thank You!

I will try very close.

Regards

elettronica67

  • Guest
Re: wxPlotWindow problems
« Reply #3 on: February 21, 2008, 01:51:16 pm »
Hi,

I have included the library wxmsw28d_plot (i am compiling in debug mode)

Following you can find the build logger:


-------------- Build: Debug in mis ---------------

mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL  -Wall  -g -D__WXDEBUG__    -IC:\wxMSW287\include -IC:\wxMSW287\contrib\include -IC:\wxMSW287\lib\gcc_dll\mswd  -c C:\prog\TEMP\cb\mis\mis\misMain.cpp -o obj\Debug\misMain.o
windres.exe -i C:\prog\TEMP\cb\mis\mis\resource.rc -J rc -o obj\Debug\resource.res -O coff -IC:\wxMSW287\include -IC:\wxMSW287\lib\gcc_dll\mswd
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL  -Wall  -g -D__WXDEBUG__    -IC:\wxMSW287\include -IC:\wxMSW287\contrib\include -IC:\wxMSW287\lib\gcc_dll\mswd  -c C:\prog\TEMP\cb\mis\mis\misApp.cpp -o obj\Debug\misApp.o
mingw32-g++.exe -LC:\wxMSW287\lib\gcc_dll -Lc:\wxMSW287\lib\vc_lib -Lc:\wxMSW287\lib\gcc_lib  -o bin\Debug\mis.exe obj\Debug\misMain.o obj\Debug\misApp.o  obj\Debug\resource.res   -lwxmsw28d_plot -lwxmsw28d  -mwindows
obj\Debug\misMain.o: In function `ZN8misFrameC2EP8wxWindowi':
C:/prog/TEMP/cb/mis/mis/misMain.cpp:96: undefined reference to `_imp___ZN12wxPlotWindowC1EP8wxWindowiRK7wxPointRK6wxSizei'
obj\Debug\misMain.o: In function `ZN8misFrameC1EP8wxWindowi':
C:/prog/TEMP/cb/mis/mis/misMain.cpp:96: undefined reference to `_imp___ZN12wxPlotWindowC1EP8wxWindowiRK7wxPointRK6wxSizei'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 6 seconds)
2 errors, 0 warnings
 
Thank you

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: wxPlotWindow problems
« Reply #4 on: February 21, 2008, 06:35:41 pm »
Quote
-LC:\wxMSW287\lib\gcc_dll -Lc:\wxMSW287\lib\vc_lib -Lc:\wxMSW287\lib\gcc_lib

Having these 3 together is wrong!

Are you doing GCC?
Are you doing wxWidgets DLL?

If yes to both, then -LC:\wxMSW287\lib\gcc_dll is right one to use; get rid of the other two.

Tim S
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

elettronica67

  • Guest
Re: wxPlotWindow problems
« Reply #5 on: February 23, 2008, 08:02:57 am »
Hi,

Thank you for your help.
I have removed the gcc_lib from the paths, but I have problems.

When I did compile the plot project I used the string "mingw32-make.exe -f makefile.gcc" and all was good.
the linker created the library "libwxmsw28d_plot.a" under "gcc_lib" directory (that now I can't use because I am working with dll).

So, probably I have to compile the "plot" project generating a DLL!

Ok, after a lot of searches, I have found that if I want obtain a DLL I have to use "SHARED=1" in my command line.

So, I wrote: "mingw32-make.exe -f makefile.gcc SHARED=1", but the linker generates a lot of errors.
(Probably this way was not enough tested).

Do you know if can be found the compiled dll plot library?

Thank you very much for your help!


Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: wxPlotWindow problems
« Reply #6 on: February 23, 2008, 06:11:56 pm »
So, I wrote: "mingw32-make.exe -f makefile.gcc SHARED=1", but the linker generates a lot of errors.
(Probably this way was not enough tested).

You need to compile the wxWidgets library first as a DLL.

I used this command to compile both wxWidgets DLL and plot dll.
The exact command to be used varies on what is wanted.

I use the same command for both wxWidgets DLL and the other make(s) in this case plot DLL.
( You just execute the command in a different folder. )

Code
mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1
« Last Edit: February 23, 2008, 06:13:31 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: wxPlotWindow problems
« Reply #7 on: February 24, 2008, 02:00:31 am »
FYI:

After this issue is fixed, please post issues like this in the proper forum
Code::Blocks > User forums > General http://forums.codeblocks.org/index.php/board,5.0.html
Would be the closest in the case.

This forum "Code::Blocks > Developer forums (C::B DEVELOPMENT STRICTLY!) " is for the developers of Code::Blocks not people using Code::Blocks in development of other programs.

Tim S


C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

elettronica67

  • Guest
Re: wxPlotWindow problems
« Reply #8 on: February 24, 2008, 02:29:34 pm »
Ok, Thanks

elettronica67

  • Guest
Re: wxPlotWindow problems
« Reply #9 on: February 24, 2008, 06:51:11 pm »
Hi,

I apologyze for my error, I have posted in the wrong space.

However, recompiling all the wxwidgets with the "unicode" option and recompiling the plot library with the same option as you suggested my project works!!!!

Thank you very much for your help!