wxMediaCtrl错误
我想使用 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
有人能告诉我我在哪里犯了错误吗?
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 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试
使用wx-config --libs std,media
在构建中
try using
wx-config --libs std,media
in building...
要在 Linux (gstreamer 0.10) 上启用 wxMediaCtrl 来构建 wxWidgets,需要 libgconf2-dev 和 libgstreamer0.10-dev。
http://wiki.wxwidgets.org/WxMediaCtrl
To build wxWidgets with wxMediaCtrl enabled on linux (gstreamer 0.10) libgconf2-dev and libgstreamer0.10-dev are required.
http://wiki.wxwidgets.org/WxMediaCtrl