wxMediaCtrl错误

时间:2011-02-25 10:00:20

标签: wxwidgets

我想使用wxMediaCtrl为此我制作一个包含

等内容的头文件
#ifndef MEDIA_H_
#define MEDIA_H_
#include <wx/wx.h>
#include <wx/mediactrl.h>
class media: public wxFrame

{

public:

 wxWindow *window;

     media(const wxString& title);

     wxMediaCtrl *media_ctrl;

};


#endif /* MEDIA_H_ */

并使用类似

的代码制作一个cpp文件
#include "media.h"

media::media(const wxString& title)

      :wxFrame(NULL, wxID_ANY, title, wxDefaultPosition, wxSize(600, 600))

{

    window=new wxWindow(this,wxID_ANY,wxPoint(0,0),wxSize(600,600),wxBORDER_SIMPLE,wxT("window"));
    media_ctrl= new wxMediaCtrl(window, wxID_ANY , wxT(""),wxDefaultPosition, wxDefaultSize, 0, wxT(""), wxDefaultValidator, wxT("hello"));}

当我试图运行该页面时,我收到了类似

的错误
make all 
Building target: media
Invoking: GCC C++ Linker
g++ `wx-config --libs` -o"media"  ./programfiles/main.o ./programfiles/media.o   
./programfiles/media.o: In function `wxMediaCtrl::wxMediaCtrl(wxWindow*, int, wxString const&, wxPoint const&, wxSize const&, long, wxString const&, wxValidator const&, wxString const&)':
media.cpp:(.text._ZN11wxMediaCtrlC1EP8wxWindowiRK8wxStringRK7wxPointRK6wxSizelS4_RK11wxValidatorS4_[wxMediaCtrl::wxMediaCtrl(wxWindow*, int, wxString const&, wxPoint const&, wxSize const&, long, wxString const&, wxValidator const&, wxString const&)]+0x35): ****undefined reference to `vtable for wxMediaCtrl'****
media.cpp:(.text._ZN11wxMediaCtrlC1EP8wxWindowiRK8wxStringRK7wxPointRK6wxSizelS4_RK11wxValidatorS4_[wxMediaCtrl::wxMediaCtrl(wxWindow*, int, wxString const&, wxPoint const&, wxSize const&, long, wxString const&, wxValidator const&, wxString const&)]+0x9a): undefined reference to `wxMediaCtrl::Create(wxWindow*, int, wxString const&, wxPoint const&, wxSize const&, long, wxString const&, wxValidator const&, wxString const&)'
collect2: ld returned 1 exit status
make: *** [media] Error 1

任何人都可以告诉我我在哪里犯错误

2 个答案:

答案 0 :(得分:1)

尝试使用

wx-config --libs std,media

建筑......

答案 1 :(得分:0)

要在linux上启用wxMediaCtrl构建wxWidgets(gstreamer 0.10),需要libgconf2-dev和libgstreamer0.10-dev。

http://wiki.wxwidgets.org/WxMediaCtrl