[Interest] QtPlugins statically linked not loading

Nuno Santos nunosantos at imaginando.pt
Mon Jun 1 15:46:49 CEST 2015


Ulf,

I have followed your suggestion and with the same build of static Qt (with -DQT_QML_NO_DEBUGGER on) I have added the following plugins to the .pro file:

QT += qml quick

TARGET = drc
TEMPLATE = lib
DEFINES += VST

macx:{
    CONFIG += lib_bundle shared
    QTPLUGIN += qcocoa qmldbg_tcp qmldbg_tcp_qtdeclarative
    QMAKE_POST_LINK = mv -f $(TARGET) $$PWD/../vstbuild/32/$$join(TARGET,"","",".vst")/Contents/MacOS/$$TARGET
    OTHER_FILES += Info.plist
    LIBS += /Users/nsantos/Qt/5.4/clang_32_static/qml/QtQuick.2/libqtquick2plugin.a
    LIBS += /Users/nsantos/Qt/5.4/clang_32_static/qml/QtQuick/Window.2/libwindowplugin.a
    LIBS += /Users/nsantos/Qt/5.4/clang_32_static/qml/QtQuick/Controls/libqtquickcontrolsplugin.a
}

Then I have rebuilt my plugin bundle.

rm -f libdrc.dylib
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -headerpad_max_install_names -arch i386 -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -stdlib=libc++ -mmacosx-version-min=10.7 -single_module -dynamiclib -o libdrc.dylib audioeffect.o audioeffectx.o vstplugmain.o IVstWrapper.o qrc_qml.o qrc_resources.o moc_IVstWrapper.o  /Users/nsantos/Qt/5.4/clang_32_static/qml/QtQuick.2/libqtquick2plugin.a -L/Users/nsantos/Qt/5.4/clang_32_static/lib -framework DiskArbitration -framework IOKit -framework ApplicationServices -framework CoreServices -framework CoreFoundation -framework Foundation -framework Cocoa -framework OpenGL -framework AGL -framework Security -framework SystemConfiguration /Users/nsantos/Qt/5.4/clang_32_static/qml/QtQuick/Window.2/libwindowplugin.a /Users/nsantos/Qt/5.4/clang_32_static/qml/QtQuick/Controls/libqtquickcontrolsplugin.a -framework Carbon -lQt5Quick -L/Users/nsantos/Qt/5.4/clang_32_static/plugins/platforms -lqcocoa -lcups -lQt5PlatformSupport -lQt5PrintSupport -L/Users/nsantos/Qt/5.4/clang_32_static/plugins/qmltooling -lqmldbg_tcp -lQt5Qml -L/Users/nsantos/Qt/5.4/clang_32_static/plugins/qml1tooling -lqmldbg_tcp_qtdeclarative -lQt5Declarative -lQt5Sql -lQt5XmlPatterns -lQt5Widgets -lQt5Gui -lqtharfbuzzng -lQt5Script -lQt5Network -lQt5Core -lz -lm  
mv -f libdrc.dylib /Users/nsantos/Dropbox/workspace/drc/vst/../vstbuild/32/drc.vst/Contents/MacOS/drc

And changed my Qt installation path:

BIGMAC:5.4 nsantos$ mv /Users/nsantos/Qt/5.4/clang_32_static /Users/nsantos/Qt/5.4/clang_32_static_1

And then loaded the plugin host app as well as the plugin, and this was the result:

BIGMAC:MacOS nsantos$ ./Live 
"/Applications/Ableton Live 9 Standard.app/Contents/MacOS"
"/Users/nsantos/Qt/5.4/clang_32_static/plugins"
QQmlApplicationEngine failed to load component
qrc:/main.qml:2 module "QtQuick.Window" is not installed
qrc:/main.qml:4 module "QtQuick.Window" is not installed
qrc:/main.qml:1 module "QtQuick" is not installed
qrc:/main.qml:2 module "QtQuick.Window" is not installed
qrc:/main.qml:4 module "QtQuick.Window" is not installed
qrc:/main.qml:1 module "QtQuick" is not installed
qrc:/main.qml:2 module "QtQuick.Window" is not installed
qrc:/main.qml:4 module "QtQuick.Window" is not installed
qrc:/main.qml:1 module "QtQuick" is not installed

Qt is not able to load the plugins if I change the path of the Qt installation directory which makes me believe that somehow, Qt is still trying to load plugins dynamically and not statically.

Regards,

Nuno

> On 01/06/2015, at 14:28, Ulf Hermann <ulf.hermann at theqtcompany.com> wrote:
> 
>> When I built Qt statically I had used this line:
>> 
>> configure -prefix /Users/nsantos/Qt/5.4/clang_32_static -platform macx-clang-32 -commercial -release -static -nomake examples -nomake tests -opengl desktop -skip webkit -skip multimedia -D QT_QML_NO_DEBUGGER
>> 
>> I had to use -DQT_QML_NO_DEBUGGER because there was an issue when linking a project using QtQml:
>> 
>> Undefined symbols for architecture i386:
>>  "QTcpServerConnection::QTcpServerConnection()", referenced from:
>>      QQmlDebugServerThread::run() in libQt5Qml.a(qqmldebugserver.o)
>> ld: symbol(s) not found for architecture i386
>> 
>> Do you think there is a relation between these two problems?
> 
> This is exactly what I'm talking about. As you seem to specify all the plugins manually anyway, you may want to drop -DQT_QML_NO_DEBUGGER and specify the qmldbg_tcp plugin in the .pro file, as that contains the implementation of QTcpServerConnection. Unless, of course, you don't want to do any QML debugging and profiling. In that case you should stick to -DQT_QML_NO_DEBUGGER.
> 
> -- 
> Ulf Hermann, Software Engineer | The Qt Company
> 
> The Qt Company GmbH, Rudower Chaussee 13, D-12489 Berlin
> Geschäftsführer: Mika Pälsi, Juha Varelius, Tuula Haataja Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B
> 
> Email: ulf.hermann at theqtcompany.com | Mobile: + 49 151 68964561 | Phone: +49 30 63 92 3255 www.qt.io |Qt Blog: http://blog.qt.digia.com/ | Twitter: @QtbyDigia, @Qtproject | Facebook: www.facebook.com/qt

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150601/7ff9ac63/attachment.html>


More information about the Interest mailing list