How to fix such errors occurred?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, Dear Sir or Madam,

PS C:\plplot-5.15.0\build> gcc --version
gcc.exe (MinGW-W64 x86_64-ucrt-posix-seh, built by Brecht Sanders) 13.2.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


In my application, I used wxWidgets library and PLplot's wxwidgets binding: wxPLplotwindow.h.
I have successfully built PLplot library via CMake+MinGW64 compilers, but when using PLplot wxwidgets, the following errors occurred. Could someone help me with this problem?

I really need to fix these errors that occurred from PLplot's wxwidgets binding and then proceed to build my application.  In my eyes there is nothing wrong in the plotwindow.h head file and please see the attached file for details. But GNU compiler generated such errors. It is very weird to me.

By the way, I downloaded it from the site: http://plplot.org/downloads.php. In my application, I need to have wxWidgets for GUI and PLplot for graph plotting, especially wxwidgets binding of PLplot library. I


I look forward to your help.

Thanks and Regards,

Dingjun


........................
[ 47%] Building CXX object LibProject/src/CMakeFiles/PHCSharedlibrary.dir/twacRcnstruct.cpp.obj
[ 48%] Building CXX object LibProject/src/CMakeFiles/PHCSharedlibrary.dir/xyzUtils.cpp.obj
[ 49%] Building CXX object LibProject/src/CMakeFiles/PHCSharedlibrary.dir/xyzfilein.cpp.obj
[ 50%] Linking CXX static library C:\Users\Dingjun.Chen\PHC_cmake\PHC_EXE_Lib_mingw64_plplot2\lib\libPHCSharedlibrary.a
[ 50%] Built target PHCSharedlibrary
[ 51%] Building CXX object MainProject/src/CMakeFiles/PHC_EXEProject.dir/BasePlot.cpp.obj
In file included from C:/Users/Dingjun.Chen/PHC_cmake/PHC_EXE_Lib_mingw64_plplot2/MainProject/include/BasePlot.h:23,
from C:\Users\Dingjun.Chen\PHC_cmake\PHC_EXE_Lib_mingw64_plplot2\MainProject\src\BasePlot.cpp:34:
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
83 | class wxPLplotwindow;
| ^~~~~~~~~~~~~~
In file included from C:/Users/Dingjun.Chen/PHC_cmake/PHC_EXE_Lib_mingw64_plplot2/MainProject/include/plotWindow.h:21:
C:/Users/Dingjun.Chen/Downloads/plplot-5.14.0.tar/plplot-5.14.0/bindings/wxwidgets/wxPLplotwindow.h:37:7: note: previous declaration here
37 | class wxPLplotwindow : public WXWINDOW
| ^~~~~~~~~~~~~~
C:/Users/Dingjun.Chen/PHC_cmake/PHC_EXE_Lib_mingw64_plplot2/MainProject/include/plotWindow.h:86:1: error: expected class-name before '{' token
86 | {
| ^

Dingjun Chen  | Software Developer

[Geotech Airborne Geophysical Surveys]

Geotech Ltd. dba Geotech Airborne | 270 INDUSTRIAL PKY S | AURORA ON CA | L4G 3T9
T: +1 905 841 5004 | Dingjun.Chen@xxxxxxxxxxxxxxxxxxx<mailto:Dingjun.Chen@xxxxxxxxxxxxxxxxxxx> | www.geotechairborne.com<www.geotech.ca>

P Please consider the environment before printing this email

This message may contain PRIVILEGED AND PROPRIETARY INFORMATION intended solely for the use of the addressee (s) named above. Any disclosure, distribution, copying, or use of the information by others is strictly prohibited. If you have received this message in error, please advise the sender by immediate reply and delete the original message.
/*
 * PlotWindow.h - Common plot window for process half cycle viewers
 *
 *  Created on: 15-May-2012
 *      Author: Maz Shahabi.
 *
 *  2012-09-07  MS  Renamed custom event to avoid potential conflict with wxWidgets
 *  2013-07-29  MS  Added mouse wheel speed detection.
 *
 */


#ifndef __PLOT_WINDOW_H__
#define __PLOT_WINDOW_H__



#include <wx/msgdlg.h>
#include <wx/textctrl.h>
#include <wx/timer.h>
#include "wxPLplotwindow.h"                         // For graph window.

#ifndef MAX
#define MAX( a, b )    ( ( a ) < ( b ) ? ( b ) : ( a ) )
#endif
#ifndef MIN
#define MIN( a, b )    ( ( a ) < ( b ) ? ( a ) : ( b ) )
#endif


// Maximum count of commands in Queue.
#define         MAX_CMND_CNT        5


// Structure which hold command queue.
typedef struct {
    int         cmnd;               // Command to execute. ( ie, zoom, move, none )
    int         dir;                // Direction when applicable.
    bool        served;             // When set the struct is waiting to be served.
    double      currWx;             // Current world coordinate for x.
    double      currWy;             // Current world coordinate for y. ( Needs direction correction!!! )
    double      lastWx;             // Last world coordinate for x.
    double      lastWy;             // Last world coordinate for y.
    double      zoomFactor;         // Zoom factor when applicable.

} plotNavStructT;


//--------------------------------------------------------------------------
// constants
//--------------------------------------------------------------------------
enum { PLUS_SIGN    =43,
       MINUS_SIGN   =45 };

// Comand set
enum {
        NULLCMD = 100,
        MOVE_CMD,
        ZOOM_IN,
        ZOOM_OUT,
        ZOOM_IN_H,
        ZOOM_OUT_H,
        ZOOM_IN_V,
        ZOOM_OUT_V
      };

// Direction
enum {
        NO_DIR = 200,
        UP_DIR,
        DN_DIR,
        LT_DIR,
        RT_DIR,
        ZOOM_ONLY
     };




// Events to be generated for the cal plot class.
wxDECLARE_EVENT( gemEVT_PLOT_ACTION_EVENT,   wxCommandEvent );   
// Notifies parent of some action
class wxPLplotwindow;
// Generic class interfacing with the plplot. To be used by other plot classes
class PlotWindow : public wxPLplotwindow
{
    public:
        ~PlotWindow(){ m_timerPtr->Stop(); }
        PlotWindow( wxFrame * frame, wxWindowID id = -1,
                                        const wxPoint& pos = wxDefaultPosition,
                                        const wxSize & size = wxDefaultSize,
                                        long style = 0,
                                        int pl_style = wxPLPLOT_NONE );

        virtual void    OnMouseWheel( wxMouseEvent & );

    private:
        wxFrame       * m_framePtr;                 // Pointer to parent class.
        wxTimer       * m_timerPtr;                 // Pointer to timer
        plotNavStructT  m_aPlotCmnd[MAX_CMND_CNT];  // Command list
        double          m_dZoomFactor;
        int             m_iNextCmndIdx;             // Index of the next command in queue
        int             m_iKeyDelayCount;           // Delay between key strokes
        int             m_iWheelDelayCount;         // Delay between wheel events

        wxPoint         m_currMouseLoc;             // Current x,y location of mouse.
        wxPoint         m_lastMouseLoc;             // Last x,y location of mouse.

        bool            m_bLeftMouseBtnIsDn;        // Logic indicates left mouse button is pressed.
        bool            m_bRightMouseBtnIsDn;       // Logic indicates right mouse button is pressed.
                                                    // Converts mouse location to world coordinates.
        void            CurrWorldPointUpdate( wxPoint, double & , double & );
                                                    // Generates command events for the frame.
        void            NavigationCmndGenrate( int, int, int = 0 );
        void            OnChar( wxKeyEvent & );     // Keyboard event handler.
                                                    // Mouse event handlers.
        virtual void    OnMouseMotion(  wxMouseEvent & );
        virtual void    OnMouseLeftDn(  wxMouseEvent & );
        virtual void    OnMouseLeftUp(  wxMouseEvent & );
        virtual void    OnMouseRightDn( wxMouseEvent & );
        virtual void    OnMouseRightUp( wxMouseEvent & );

                                                    // Timer event handlers.
        virtual void    OnTimerEvent(   wxTimerEvent & );


};


#endif // __PLOT_WINDOW_H__









[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux