0
我對wxsashlayoutwindow工作creatiing wxSashLayoutWindow但我不能夠執行,有人請幫我出這鏈接錯誤,而在wxWidgets的
的這些鏈接錯誤,我得到:
1>MyFrame.obj : error LNK2019: unresolved external symbol "public: bool __thiscall
wxLayoutAlgorithm::LayoutFrame(class wxFrame *,class wxWindow *)" (?
[email protected]@@[email protected]@[email protected]@@Z) referenced in function
"public: __thiscall MyFrame::MyFrame(class wxWindow *,int,class wxString const &,class
wxPoint const &,class wxSize const &,long,class wxString const &)" (??
[email protected]@[email protected]@@[email protected]@[email protected]@[email protected]@[email protected])
1>MyFrame.obj : error LNK2019: unresolved external symbol "public: void __thiscall
wxSashWindow::SetSashVisible(enum wxSashEdgePosition,bool)" (?
[email protected]@@[email protected]@[email protected]) referenced in function
"public: __thiscall MyFrame::MyFrame(class wxWindow *,int,class wxString const &,class
wxPoint const &,class wxSize const &,long,class wxString const &)" (??
[email protected]@[email protected]@@[email protected]@[email protected]@[email protected]@[email protected])
1>MyFrame.obj : error LNK2019: unresolved external symbol "public: bool __thiscall
wxSashLayoutWindow::Create(class wxWindow *,int,class wxPoint const &,class wxSize const
&,long,class wxString const &)" (?
[email protected]@@[email protected]@[email protected]@[email protected]@[email protected]@@Z)
referenced in function "public: __thiscall MyFrame::MyFrame(class wxWindow *,int,class
wxString const &,class wxPoint const &,class wxSize const &,long,class wxString const &)"
([email protected]@[email protected]@@[email protected]@[email protected]@[email protected]@[email protected])
1>MyFrame.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall
wxSashWindow::~wxSashWindow(void)" ([email protected]@[email protected]) referenced in function
[email protected]@[email protected]$0
1>MyFrame.obj : error LNK2019: unresolved external symbol "private: void __thiscall
wxSashLayoutWindow::Init(void)" ([email protected]@@AAEXXZ) referenced in function
"public: __thiscall wxSashLayoutWindow::wxSashLayoutWindow(void)" (??
[email protected]@[email protected])
1>MyFrame.obj : error LNK2001: unresolved external symbol "public: virtual class
wxClassInfo * __thiscall wxSashLayoutWindow::GetClassInfo(void)const " (?
[email protected]@@[email protected]@XZ)
1>MyFrame.obj : error LNK2001: unresolved external symbol "protected: virtual struct
wxEventTable const * __thiscall wxSashLayoutWindow::GetEventTable(void)const " (?
[email protected]@@[email protected]@XZ)
1>MyFrame.obj : error LNK2001: unresolved external symbol "protected: virtual class
wxEventHashTable & __thiscall wxSashLayoutWindow::GetEventHashTable(void)const " (?
[email protected]@@[email protected]@XZ)
1>MyFrame.obj : error LNK2019: unresolved external symbol "private: void __thiscall
wxSashWindow::Init(void)" ([email protected]@@AAEXXZ) referenced in function "public:
__thiscall wxSashWindow::wxSashWindow(void)" ([email protected]@[email protected])
1>MyFrame.obj : error LNK2001: unresolved external symbol "public: virtual class
wxClassInfo * __thiscall wxSashWindow::GetClassInfo(void)const " (?
[email protected]@@[email protected]@XZ)
1>MyFrame.obj : error LNK2001: unresolved external symbol "protected: virtual struct
wxEventTable const * __thiscall wxSashWindow::GetEventTable(void)const " (?
[email protected]@@MBEPBUwxEventT[email protected]@XZ)
1>MyFrame.obj : error LNK2001: unresolved external symbol "protected: virtual class
wxEventHashTable & __thiscall wxSashWindow::GetEventHashTable(void)const " (?
[email protected]@@[email protected]@XZ)
1>MyFrame.obj : error LNK2001: unresolved external symbol "int const wxEVT_SASH_DRAGGED" (?
[email protected]@3HB)
這是我的代碼:
//Frame.h
#ifndef __MAIN_FRAME__
#define __MAIN_FRAME__
#include "wx/frame.h"
#include <wx/laywin.h>
//#include <wx/sashwin.h>
class MyFrame : public wxFrame
{
public:
MyFrame();
MyFrame(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, const wxString& name = _T("Frame"));
~MyFrame();
void OnDrag(wxSashEvent &event);
void OnSize(wxSizeEvent& event);
private:
wxLayoutAlgorithm _layout;
wxSashLayoutWindow *window;
wxSize siz;
DECLARE_DYNAMIC_CLASS(MyFrame)
DECLARE_EVENT_TABLE()
};
#endif
//Frame.cpp
enum
{
ID_BTN_FIRST = 100,
SASHID
};
IMPLEMENT_DYNAMIC_CLASS(MyFrame, wxFrame)
BEGIN_EVENT_TABLE(MyFrame ,wxFrame)
EVT_SASH_DRAGGED(SASHID ,MyFrame::OnDrag)
EVT_SIZE(MyFrame::OnSize)
END_EVENT_TABLE()
MyFrame::MyFrame()
{
}
MyFrame::~MyFrame()
{
}
MyFrame::MyFrame(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &pos, const wxSize &size , long style , const wxString &name)
:wxFrame(parent, id, title, pos, size, style, name)
{
siz = wxGetDisplaySize();
window = new wxSashLayoutWindow();
window->Create(this ,SASHID);
window->SetDefaultSize(wxSize(200 ,siz.GetHeight()));
window->SetOrientation(wxLAYOUT_VERTICAL);
window->SetAlignment(wxLAYOUT_LEFT);
window->SetBackgroundColour(this->GetBackgroundColour());
window->SetSashVisible(wxSASH_RIGHT, true);
wxPanel *panel = new wxPanel(this);
MWTreeCtrl *tree = new MWTreeCtrl(window);
_layout.LayoutFrame(this ,panel);
}
void MyFrame::OnDrag(wxSashEvent &event)
{
window->SetDefaultSize(wxSize(event.GetDragRect().width, siz.GetHeight()));
_layout.LayoutFrame(this ,panel);
}
void MyFrame::OnSize(wxSizeEvent& event)
{
_layout.LayoutFrame(this ,panel);
}
並且還的 「庫」 部分[wxSashWindow文檔】(http://docs.wxwidgets.org/trunk/classwx_sash_window.html) – 2013-05-02 22:42:53