mkarlsso
9th October 2015, 19:57
I am trying to deploy my application on Ubuntu 14.04 using dynamic linking, but the application appears to have a problem loading one of the plugins (mediaservice/libgstcamerabin.so). The program needs to stream video from a USB webcam and works just fine when I have Qt installed on the machine, but not when it is not. Here is what I have done:
1) Copied over all required libs into the same directory as the application
2) Copied over all required plugins into subfolders in the same directory as the application (including platforms/libqxcb.so and so on)
3) Made a shell script that opens the application and sets the library search path to the current directory (copied from here: http://doc.qt.io/qt-5/linux-deployment.html)
4) In the shell script, I added export QT_DEBUG_PLUGINS=1 to show which plugins are being added.
Then, I run the script, either with Qt installed or without. In both cases the program starts just fine. With qt installed, the program finds the connected USB webcam and starts streaming video. If I remove the Qt directory, the program still starts just fine but can't find the webcam. Looking at the plugin debug outputs I see this:
QFactoryLoader::QFactoryLoader() checking directory path "/home/maxim/trodes/Bin/mediaservice" ...
QFactoryLoader::QFactoryLoader() looking at "/home/maxim/trodes/Bin/mediaservice/libgstaudiodecoder.so"
Found metadata in lib /home/maxim/trodes/Bin/mediaservice/libgstaudiodecoder.so, metadata=
{
"IID": "org.qt-project.qt.mediaserviceproviderfactory/5.0",
"MetaData": {
"Keys": [
"gstreameraudiodecode"
],
"Services": [
"org.qt-project.qt.audiodecode"
]
},
"className": "QGstreamerAudioDecoderServicePlugin",
"debug": false,
"version": 328960
}
Got keys from plugin meta data ("gstreameraudiodecode")
QFactoryLoader::QFactoryLoader() looking at "/home/maxim/trodes/Bin/mediaservice/libgstcamerabin.so"
Found metadata in lib /home/maxim/trodes/Bin/mediaservice/libgstcamerabin.so, metadata=
{
"IID": "org.qt-project.qt.mediaserviceproviderfactory/5.0",
"MetaData": {
"Keys": [
"gstreamercamerabin"
],
"Services": [
"org.qt-project.qt.camera"
]
},
"className": "CameraBinServicePlugin",
"debug": false,
"version": 328960
}
Got keys from plugin meta data ("gstreamercamerabin")
QFactoryLoader::QFactoryLoader() looking at "/home/maxim/trodes/Bin/mediaservice/libgstmediacapture.so"
Found metadata in lib /home/maxim/trodes/Bin/mediaservice/libgstmediacapture.so, metadata=
{
"IID": "org.qt-project.qt.mediaserviceproviderfactory/5.0",
"MetaData": {
"Keys": [
"gstreamermediacapture"
],
"Services": [
"org.qt-project.qt.audiosource"
]
},
"className": "QGstreamerCaptureServicePlugin",
"debug": false,
"version": 328960
}
Got keys from plugin meta data ("gstreamermediacapture")
QFactoryLoader::QFactoryLoader() looking at "/home/maxim/trodes/Bin/mediaservice/libgstmediaplayer.so"
Found metadata in lib /home/maxim/trodes/Bin/mediaservice/libgstmediaplayer.so, metadata=
{
"IID": "org.qt-project.qt.mediaserviceproviderfactory/5.0",
"MetaData": {
"Keys": [
"gstreamermediaplayer"
],
"Services": [
"org.qt-project.qt.mediaplayer"
]
},
"className": "QGstreamerPlayerServicePlugin",
"debug": false,
"version": 328960
}
Got keys from plugin meta data ("gstreamermediaplayer")
loaded library "/home/maxim/trodes/Bin/mediaservice/libgstcamerabin.so"
QLibraryPrivate::loadPlugin failed on "/home/maxim/trodes/Bin/mediaservice/libgstcamerabin.so" : "Cannot load library /home/maxim/trodes/Bin/mediaservice/libgstcamerabin.so: (/home/maxim/trodes/Bin/mediaservice/libgstcamerabin.so: undefined symbol: _ZTI21QGstreamerBufferProbe)"
Webcams: ()
So it looks like it finds the required plugins just fine, but not one if it dependencies? Any advice is appreciated.
1) Copied over all required libs into the same directory as the application
2) Copied over all required plugins into subfolders in the same directory as the application (including platforms/libqxcb.so and so on)
3) Made a shell script that opens the application and sets the library search path to the current directory (copied from here: http://doc.qt.io/qt-5/linux-deployment.html)
4) In the shell script, I added export QT_DEBUG_PLUGINS=1 to show which plugins are being added.
Then, I run the script, either with Qt installed or without. In both cases the program starts just fine. With qt installed, the program finds the connected USB webcam and starts streaming video. If I remove the Qt directory, the program still starts just fine but can't find the webcam. Looking at the plugin debug outputs I see this:
QFactoryLoader::QFactoryLoader() checking directory path "/home/maxim/trodes/Bin/mediaservice" ...
QFactoryLoader::QFactoryLoader() looking at "/home/maxim/trodes/Bin/mediaservice/libgstaudiodecoder.so"
Found metadata in lib /home/maxim/trodes/Bin/mediaservice/libgstaudiodecoder.so, metadata=
{
"IID": "org.qt-project.qt.mediaserviceproviderfactory/5.0",
"MetaData": {
"Keys": [
"gstreameraudiodecode"
],
"Services": [
"org.qt-project.qt.audiodecode"
]
},
"className": "QGstreamerAudioDecoderServicePlugin",
"debug": false,
"version": 328960
}
Got keys from plugin meta data ("gstreameraudiodecode")
QFactoryLoader::QFactoryLoader() looking at "/home/maxim/trodes/Bin/mediaservice/libgstcamerabin.so"
Found metadata in lib /home/maxim/trodes/Bin/mediaservice/libgstcamerabin.so, metadata=
{
"IID": "org.qt-project.qt.mediaserviceproviderfactory/5.0",
"MetaData": {
"Keys": [
"gstreamercamerabin"
],
"Services": [
"org.qt-project.qt.camera"
]
},
"className": "CameraBinServicePlugin",
"debug": false,
"version": 328960
}
Got keys from plugin meta data ("gstreamercamerabin")
QFactoryLoader::QFactoryLoader() looking at "/home/maxim/trodes/Bin/mediaservice/libgstmediacapture.so"
Found metadata in lib /home/maxim/trodes/Bin/mediaservice/libgstmediacapture.so, metadata=
{
"IID": "org.qt-project.qt.mediaserviceproviderfactory/5.0",
"MetaData": {
"Keys": [
"gstreamermediacapture"
],
"Services": [
"org.qt-project.qt.audiosource"
]
},
"className": "QGstreamerCaptureServicePlugin",
"debug": false,
"version": 328960
}
Got keys from plugin meta data ("gstreamermediacapture")
QFactoryLoader::QFactoryLoader() looking at "/home/maxim/trodes/Bin/mediaservice/libgstmediaplayer.so"
Found metadata in lib /home/maxim/trodes/Bin/mediaservice/libgstmediaplayer.so, metadata=
{
"IID": "org.qt-project.qt.mediaserviceproviderfactory/5.0",
"MetaData": {
"Keys": [
"gstreamermediaplayer"
],
"Services": [
"org.qt-project.qt.mediaplayer"
]
},
"className": "QGstreamerPlayerServicePlugin",
"debug": false,
"version": 328960
}
Got keys from plugin meta data ("gstreamermediaplayer")
loaded library "/home/maxim/trodes/Bin/mediaservice/libgstcamerabin.so"
QLibraryPrivate::loadPlugin failed on "/home/maxim/trodes/Bin/mediaservice/libgstcamerabin.so" : "Cannot load library /home/maxim/trodes/Bin/mediaservice/libgstcamerabin.so: (/home/maxim/trodes/Bin/mediaservice/libgstcamerabin.so: undefined symbol: _ZTI21QGstreamerBufferProbe)"
Webcams: ()
So it looks like it finds the required plugins just fine, but not one if it dependencies? Any advice is appreciated.