i want to use wxMediaCtrl for this i make a header file with content like
#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_ */
and make a cpp file with code like
#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"));}
when i m trying to run the page ,i got an error like
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 开发者_StackOverflow社区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
can anyone tell me where i m doing the mistake
try using
wx-config --libs std,media
in building...
To build wxWidgets with wxMediaCtrl enabled on linux (gstreamer 0.10) libgconf2-dev and libgstreamer0.10-dev are required.
http://wiki.wxwidgets.org/WxMediaCtrl
精彩评论