<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent posts to How to fix this error occurred from wxwidgets binding of PLplot library?</title><link>https://sourceforge.net/p/plplot/discussion/8607/thread/d7da72bb0f/</link><description>Recent posts to How to fix this error occurred from wxwidgets binding of PLplot library?</description><atom:link href="https://sourceforge.net/p/plplot/discussion/8607/thread/d7da72bb0f/feed.rss" rel="self"/><language>en</language><lastBuildDate>Tue, 05 Sep 2023 20:16:14 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/plplot/discussion/8607/thread/d7da72bb0f/feed.rss" rel="self" type="application/rss+xml"/><item><title>How to fix this error occurred from wxwidgets binding of PLplot library?</title><link>https://sourceforge.net/p/plplot/discussion/8607/thread/d7da72bb0f/?limit=25#a5e5</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Hi, Dear Sir or Madam,&lt;/p&gt;
&lt;p&gt;In my application, I used wxWidgets library and PLplot's wxwidgets binding: wxPLplotwindow.h.&lt;br/&gt;
I have successfully built PLplot library but when using PLplot wxwidgets, the following errors occurred. Could someone help me with this problem?&lt;br/&gt;
I really need to fix these errors occurred from PLplot's wxwidgets binding and then proceed to build my application.&lt;/p&gt;
&lt;p&gt;I look forward to your help.&lt;/p&gt;
&lt;p&gt;Thanks and Regards,&lt;/p&gt;
&lt;p&gt;Dingjun&lt;/p&gt;
&lt;p&gt;........................&lt;br/&gt;
&lt;span&gt;[ 47%]&lt;/span&gt; Building CXX object LibProject/src/CMakeFiles/PHCSharedlibrary.dir/twacRcnstruct.cpp.obj&lt;br/&gt;
&lt;span&gt;[ 48%]&lt;/span&gt; Building CXX object LibProject/src/CMakeFiles/PHCSharedlibrary.dir/xyzUtils.cpp.obj&lt;br/&gt;
&lt;span&gt;[ 49%]&lt;/span&gt; Building CXX object LibProject/src/CMakeFiles/PHCSharedlibrary.dir/xyzfilein.cpp.obj&lt;br/&gt;
&lt;span&gt;[ 50%]&lt;/span&gt; Linking CXX static library C:\Users\Dingjun.Chen\PHC_cmake\PHC_EXE_Lib_mingw64_plplot2\lib\libPHCSharedlibrary.a&lt;br/&gt;
&lt;span&gt;[ 50%]&lt;/span&gt; Built target PHCSharedlibrary&lt;br/&gt;
&lt;span&gt;[ 51%]&lt;/span&gt; Building CXX object MainProject/src/CMakeFiles/PHC_EXEProject.dir/BasePlot.cpp.obj&lt;br/&gt;
In file included from C:/Users/Dingjun.Chen/PHC_cmake/PHC_EXE_Lib_mingw64_plplot2/MainProject/include/BasePlot.h:23,&lt;br/&gt;
from C:\Users\Dingjun.Chen\PHC_cmake\PHC_EXE_Lib_mingw64_plplot2\MainProject\src\BasePlot.cpp:34:&lt;br/&gt;
C:/Users/Dingjun.Chen/PHC_cmake/PHC_EXE_Lib_mingw64_plplot2/MainProject/include/plotWindow.h:83:7: error: class template 'wxPLplotwindow' redeclared as non-template&lt;br/&gt;
83 | class wxPLplotwindow;&lt;br/&gt;
| ^~~~~~~~~~~~~~&lt;br/&gt;
In file included from C:/Users/Dingjun.Chen/PHC_cmake/PHC_EXE_Lib_mingw64_plplot2/MainProject/include/plotWindow.h:21:&lt;br/&gt;
C:/Users/Dingjun.Chen/Downloads/plplot-5.14.0.tar/plplot-5.14.0/bindings/wxwidgets/wxPLplotwindow.h:37:7: note: previous declaration here&lt;br/&gt;
37 | class wxPLplotwindow : public WXWINDOW&lt;br/&gt;
| ^~~~~~~~~~~~~~&lt;br/&gt;
C:/Users/Dingjun.Chen/PHC_cmake/PHC_EXE_Lib_mingw64_plplot2/MainProject/include/plotWindow.h:86:1: error: expected class-name before '{' token&lt;br/&gt;
86 | {&lt;br/&gt;
| ^&lt;/p&gt;
&lt;p&gt;/&lt;strong&gt;&lt;em&gt;*&lt;/em&gt;* plotWindow.h &lt;/strong&gt;&lt;strong&gt;&lt;em&gt;*&lt;/em&gt;&lt;/strong&gt;*/&lt;/p&gt;
&lt;h1 id="ifndef-plot_window_h"&gt;ifndef &lt;strong&gt;PLOT_WINDOW_H&lt;/strong&gt;&lt;/h1&gt;
&lt;h1 id="define-plot_window_h"&gt;define &lt;strong&gt;PLOT_WINDOW_H&lt;/strong&gt;&lt;/h1&gt;
&lt;h1 id="include"&gt;include &amp;lt;wx msgdlg.h=""&amp;gt;&amp;lt;/wx&amp;gt;&lt;/h1&gt;
&lt;h1 id="include_1"&gt;include &amp;lt;wx textctrl.h=""&amp;gt;&amp;lt;/wx&amp;gt;&lt;/h1&gt;
&lt;h1 id="include_2"&gt;include &amp;lt;wx timer.h=""&amp;gt;&amp;lt;/wx&amp;gt;&lt;/h1&gt;
&lt;h1 id="include-wxplplotwindowh-for-graph-window"&gt;include "wxPLplotwindow.h" // For graph window.&lt;/h1&gt;
&lt;h1 id="ifndef-max"&gt;ifndef MAX&lt;/h1&gt;
&lt;h1 id="define-max-a-b-a-b-b-a"&gt;define MAX( a, b ) ( ( a ) &amp;lt; ( b ) ? ( b ) : ( a ) )&lt;/h1&gt;
&lt;h1 id="endif"&gt;endif&lt;/h1&gt;
&lt;h1 id="ifndef-min"&gt;ifndef MIN&lt;/h1&gt;
&lt;h1 id="define-min-a-b-a-b-a-b"&gt;define MIN( a, b ) ( ( a ) &amp;lt; ( b ) ? ( a ) : ( b ) )&lt;/h1&gt;
&lt;h1 id="endif_1"&gt;endif&lt;/h1&gt;
&lt;p&gt;// Maximum count of commands in Queue.&lt;/p&gt;
&lt;h1 id="define-max_cmnd_cnt-5"&gt;define MAX_CMND_CNT 5&lt;/h1&gt;
&lt;p&gt;// Structure which hold command queue.&lt;br/&gt;
typedef struct {&lt;br/&gt;
int cmnd; // Command to execute. ( ie, zoom, move, none )&lt;br/&gt;
int dir; // Direction when applicable.&lt;br/&gt;
bool served; // When set the struct is waiting to be served.&lt;br/&gt;
double currWx; // Current world coordinate for x.&lt;br/&gt;
double currWy; // Current world coordinate for y. ( Needs direction correction!!! )&lt;br/&gt;
double lastWx; // Last world coordinate for x.&lt;br/&gt;
double lastWy; // Last world coordinate for y.&lt;br/&gt;
double zoomFactor; // Zoom factor when applicable.&lt;/p&gt;
&lt;p&gt;} plotNavStructT;&lt;/p&gt;
&lt;p&gt;//--------------------------------------------------------------------------&lt;br/&gt;
// constants&lt;br/&gt;
//--------------------------------------------------------------------------&lt;br/&gt;
enum { PLUS_SIGN =43,&lt;br/&gt;
MINUS_SIGN =45 };&lt;/p&gt;
&lt;p&gt;// Comand set&lt;br/&gt;
enum {&lt;br/&gt;
NULLCMD = 100,&lt;br/&gt;
MOVE_CMD,&lt;br/&gt;
ZOOM_IN,&lt;br/&gt;
ZOOM_OUT,&lt;br/&gt;
ZOOM_IN_H,&lt;br/&gt;
ZOOM_OUT_H,&lt;br/&gt;
ZOOM_IN_V,&lt;br/&gt;
ZOOM_OUT_V&lt;br/&gt;
};&lt;/p&gt;
&lt;p&gt;// Direction&lt;br/&gt;
enum {&lt;br/&gt;
NO_DIR = 200,&lt;br/&gt;
UP_DIR,&lt;br/&gt;
DN_DIR,&lt;br/&gt;
LT_DIR,&lt;br/&gt;
RT_DIR,&lt;br/&gt;
ZOOM_ONLY&lt;br/&gt;
};&lt;/p&gt;
&lt;p&gt;// Events to be generated for the cal plot class.&lt;br/&gt;
wxDECLARE_EVENT( gemEVT_PLOT_ACTION_EVENT, wxCommandEvent );&lt;br/&gt;
// Notifies parent of some action&lt;br/&gt;
class wxPLplotwindow;&lt;br/&gt;
// Generic class interfacing with the plplot. To be used by other plot classes&lt;br/&gt;
class PlotWindow : public wxPLplotwindow&lt;br/&gt;
{&lt;br/&gt;
public:&lt;br/&gt;
~PlotWindow(){ m_timerPtr-&amp;gt;Stop(); }&lt;br/&gt;
PlotWindow( wxFrame * frame, wxWindowID id = -1,&lt;br/&gt;
const wxPoint&amp;amp; pos = wxDefaultPosition,&lt;br/&gt;
const wxSize &amp;amp; size = wxDefaultSize,&lt;br/&gt;
long style = 0,&lt;br/&gt;
int pl_style = wxPLPLOT_NONE );&lt;/p&gt;
&lt;p&gt;virtual void OnMouseWheel( wxMouseEvent &amp;amp; );&lt;/p&gt;
&lt;p&gt;private:&lt;br/&gt;
wxFrame * m_framePtr; // Pointer to parent class.&lt;br/&gt;
wxTimer * m_timerPtr; // Pointer to timer&lt;br/&gt;
plotNavStructT m_aPlotCmnd&lt;span&gt;[MAX_CMND_CNT]&lt;/span&gt;; // Command list&lt;br/&gt;
double m_dZoomFactor;&lt;br/&gt;
int m_iNextCmndIdx; // Index of the next command in queue&lt;br/&gt;
int m_iKeyDelayCount; // Delay between key strokes&lt;br/&gt;
int m_iWheelDelayCount; // Delay between wheel events&lt;/p&gt;
&lt;p&gt;wxPoint m_currMouseLoc; // Current x,y location of mouse.&lt;br/&gt;
wxPoint m_lastMouseLoc; // Last x,y location of mouse.&lt;/p&gt;
&lt;p&gt;bool m_bLeftMouseBtnIsDn; // Logic indicates left mouse button is pressed.&lt;br/&gt;
bool m_bRightMouseBtnIsDn; // Logic indicates right mouse button is pressed.&lt;br/&gt;
// Converts mouse location to world coordinates.&lt;br/&gt;
void CurrWorldPointUpdate( wxPoint, double &amp;amp; , double &amp;amp; );&lt;br/&gt;
// Generates command events for the frame.&lt;br/&gt;
void NavigationCmndGenrate( int, int, int = 0 );&lt;br/&gt;
void OnChar( wxKeyEvent &amp;amp; ); // Keyboard event handler.&lt;br/&gt;
// Mouse event handlers.&lt;br/&gt;
virtual void OnMouseMotion( wxMouseEvent &amp;amp; );&lt;br/&gt;
virtual void OnMouseLeftDn( wxMouseEvent &amp;amp; );&lt;br/&gt;
virtual void OnMouseLeftUp( wxMouseEvent &amp;amp; );&lt;br/&gt;
virtual void OnMouseRightDn( wxMouseEvent &amp;amp; );&lt;br/&gt;
virtual void OnMouseRightUp( wxMouseEvent &amp;amp; );&lt;/p&gt;
&lt;p&gt;// Timer event handlers.&lt;br/&gt;
virtual void OnTimerEvent( wxTimerEvent &amp;amp; );&lt;/p&gt;
&lt;p&gt;};&lt;/p&gt;
&lt;h1 id="endif-plot_window_h"&gt;endif // &lt;strong&gt;PLOT_WINDOW_H&lt;/strong&gt;&lt;/h1&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dingjun Chen </dc:creator><pubDate>Tue, 05 Sep 2023 20:16:14 -0000</pubDate><guid>https://sourceforge.net0abb1424452091e7d8aacec84f04d5630e225f02</guid></item></channel></rss>