wxMediaCtrl错误

发布于 2024-10-19 10:58:28 字数 2055 浏览 3 评论 0原文

我想使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

千纸鹤带着心事 2024-10-26 10:58:28

尝试

使用wx-config --libs std,media

在构建中

try using

wx-config --libs std,media

in building...

梦幻之岛 2024-10-26 10:58:28

要在 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文