如何使用静态构建的 Qt 解决此“找不到服务 - “org.qt-project.qt.mediaplayer""错误? [英] How can I solve this 'no service found for - “org.qt-project.qt.mediaplayer”' error with a statically built Qt?

查看:369
本文介绍了如何使用静态构建的 Qt 解决此“找不到服务 - “org.qt-project.qt.mediaplayer""错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,为了为 Windows 构建静态 Qt,我关注了下一篇文章.

Hello in order to build static Qt for Windows, I followed the next article.

http://qt-project.org/wiki/How-to-build-a-static-Qt-for-Windows-MinGW

使用 Qt 版本 – 5.2.0.操作系统- Windows7.问题是它在构建项目时说 - 找不到服务 - org.qt-project.qt.mediaplayer".

Using Qt vesion – 5.2.0. Operating System- Windows7. The problem is that it says – no service found for – "org.qt-project.qt.mediaplayer" on building the project.

我搜索了网络,但没有一个有用的解决方案.也许我没有正确使用它们,因为缺乏 Qt 基础设施的知识,但无论如何,如果有人能给我一些解决这个问题的说明,我将不胜感激.

I searched the net, but no solution was useful. Maybe I’m not using them correctly because of some lack of knowledge of Qt infrastructure, but anyway if someone could give me some instructions of solving of this problem, I would really appreciate that.

推荐答案

我正在静态使用 Qt 5.2.1 OpenGL MinGW 并且遇到了同样的问题(视频没有以相同的未找到服务"播放).就我而言,我解决了在项目中链接静态媒体播放器插件 (dsengine) 的问题.为此,我必须:

I'm using statically Qt 5.2.1 OpenGL MinGW and had same problem (video wasn't playing with same "no service found"). In my case I solved the problem linking the static mediaplayer plugin (dsengine) in project. To do this I had to:

1) 在 .pro 文件中添加:

1) add in .pro file:

CONFIG += static
static:{
QTPLUGIN += dsengine
CONFIG += release
LIBS += -ldsengine
}

dsengine 插件位于 %QTDIR%/plugins/mediaservice/libdsengine.a

dsengine plugin is located in %QTDIR%/plugins/mediaservice/libdsengine.a

2) 在代码的某处添加(在 main.cpp 周围):

2) add somewhere in the code (around main.cpp):

#ifdef QT_STATIC
#include <QtCore/QtPlugin>
Q_IMPORT_PLUGIN(DSServicePlugin)
#endif

这篇关于如何使用静态构建的 Qt 解决此“找不到服务 - “org.qt-project.qt.mediaplayer""错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆