Building Qt 5.5.0 enterprise static on Linux, can't find xcb plugin at runtime



  • I'm trying to build Qt 5.5.0 static on Ubuntu 12.04.

    I have it built but get the following error at runtime:

    This application failed to start because it could not find or load the Qt platform plugin "xcb".

    I have configured my build with -qt-xcb, so not sure why it's looking for libxcb.so, which is in /usr/lib/i386-linux-gnu/, but I have tried added that to LD_LIBRARY_PATH to no avail, I've moved it to a plugin directory from where my binary is running from, but no go.

    Also, in my build, although I am building static I do see some -lQtxxxx statements included on my compile line. Using ldd I don't see any Qt libraries being loaded, so think I'm ok, but the xcb problem has me stumped.

    I am using the Enterprise Edition.

    Alan



  • I should also add that I have tried using QT_PLUGIN_PATH and QT_DIR, but can't get it to resolve.

    How does the Qt plugin get resolved?

    Ideally I tried to link in the static xcb from my build. That doesn't seem to work either, so one of the other libraries must be needing it.



  • Hi, to see where Qt looks for plugins, try export QT_DEBUG_PLUGINS=1
    For plugin loading LD_LIBRARY_PATH is irrelevant, but setting QT_PLUGIN_PATH should have worked. Hmmm, another way to force Qt to look for plugins in a directory of your choosing, you can create a qt.conf file:

    [Paths]
    Plugins=/usr/lib/i386-linux-gnu
    

    Note however: for both QT_PLUGIN_PATH and qt.conf file, Qt always appends the /platforms directory name, so for the qt.conf file above, Qt will look for libqxb.so in /usr/lib/i386-linux-gnu/platforms
    Also, since libqxb.so depends on libQt5XcbQpa.so, make sure the chrpath of libqxb.so points to a directory where you have libQt5XcbQpa.so, you can check the chrpath like this:
    chrpath libqxcb.so

    Hope this helps :-)


  • Lifetime Qt Champion

    Hi,

    To add to @hskoglund, there's something fishy going on. If you built a static Qt it should look for that plugin, it would require you to link it (if it's not already automatically done for you)



  • Yes, part of the problem was that there was some qt4 mixed in with the compile.

    I now have a pure qt5 environment, it was tricky to get the qmake for the static build used, but I figured it out. In order to create a pure Qt5 environment on Ubuntu 12.04 (which I need to support) is that I was forced not to use KDE as it uses and install a boat load of Qt4 libs.

    On 12.04 there is no Qt5, and I don't need it if I can link static. I have my static build but don't want qmake to add in the Qt5 shared libs to my shared library. (hope that makes sense)

    I have other shared libs I do want to link it, just that I don't want any Qt5 shared libs in it, I want my static libs linked in.

    qmake seems to want to add the Qt shared libs into my Makefiles.

    Is there a way to prevent that? IOW, is that a way to tell qmake not to add any of the Qt5 libs in the link line? I have all of my static libs linked in, and I can get my library to link when I manually strip out all the Qt5 libs and link manually, but if I run make it will remove the shared lib and try to link the Qt5 libs is that were put there by qmake.



  • <sound of palm slapping forehead>
    Damn, I see now that the .la files have information in them that qmake must use in determining what libs to link in. I think I need to edit those, as I also see where it has the path and directory from the machine I built them on, and on our build server that doesn't make any sense.
    </sound of palm slapping forehead>

    As best I can tell, the -L defines in the .la files can be removed, or should those point to the proper location on the build server?

    I think I can remove the Qt libs that I don't want linked in from those files? Or will that cause some other problems?

    I will clean these up tomorrow.


  • Lifetime Qt Champion

    Relocating Qt requires more than that.

    To make things go quicker: on your Qt building machine use the same prefix when you install Qt that you will on your build server.



  • I'm doing that, but it's in my home directory, and on the build server it's in the same location but in his home dir. I guess I could change them to add $HOME in the la files.

    I've ran some scripts that was supposed to change the names, but didn't realize exactly what it was changing. Now I kind of understand.

    http://linuxfromscratch.org/blfs/view/svn/x/qt5.html

    That is not a problem, I can peel that out completely as I account for the link path (-L) in my project file. I need to strip out those added Qt libs as I'm linking in static.


  • Lifetime Qt Champion

    The paths are also hardcoded in qmake so you have to patch the binaries to make it work when relocating or use a qt.conf file to tell Qt where it's located



  • @SGaist Ok, I rebuilt my static and placed it in /opt so that it would be common for all machines.

    I do have my static build, but had to strip out some of the depends in libQt5WebKit.prl, libQt5WebKitWidgets.prl and libQt5WebKitWidgets.la for WebKit1, WebCore, ANGLE, leveldb, JavaScriptCore and WTF.

    I believe those are statically compiled in the WebKit and WebKitWidgets libraries. I can link my shared library after doing so.

    The problem I run into is that it seems uic is not producing my headers and I suspect moc needs to run on some stuff also.

    I was able to run uic manually for one of the test apps, but I get a bunch of unresolved for the vtable and other stuff.

    In my project I have

    QT -= core gui

    so that it will not include -lQtCore -lQtGui, but is there some trick I need to do in order to build the project properly?

    I've worked with QT before, but not as this level.

    These sample apps have worked with shared Qt.



  • Here's an example of what I'm getting:

    On this app there was 2 header.ui files that I created the respective ui_header.h files for using uic.

    I should also add that a colleague of mine was working on the Windows compile of Qt, trying to make it static and said he was missing some of the components in WebKit, like Frame and some other stuff.

    I wonder if this is similar where I'm missing WebFrame below where it shows unresolved ????

    Do you know why that would be?

    g++ -Wl,-O1 -o ../../_bin/LinuxX86/layoutserver ../../_build/LinuxX86/release/layoutserver/main.o ../../_build/LinuxX86/release/layoutserver/LayoutServer.o ../../_build/LinuxX86/release/layoutserver/LayoutServerConnection.o ../../_build/LinuxX86/release/layoutserver/LayoutRendererHandler.o -L/home/aland/src/LSE7/_Globals/Properties/../../ThirdParty/boost_1_57_0/linux/i386/lib -L../../_bin/LinuxX86 -llayoutrenderer -limage -L../../ThirdParty/boost_1_57_0/linux/i386/lib ../../ThirdParty/boost_1_57_0/linux/i386/lib/libboost_thread.a ../../ThirdParty/boost_1_57_0/linux/i386/lib/libboost_system.a -lttrace -lboost_regex -lboost_system -lboost_filesystem -lboost_thread -lsynchronization -lzlib ../../ThirdParty/boost_1_57_0/linux/i386/lib/libboost_serialization.a ../../ThirdParty/boost_1_57_0/linux/i386/lib/libboost_filesystem.a ../../ThirdParty/boost_1_57_0/linux/i386/lib/libboost_date_time.a ../../ThirdParty/boost_1_57_0/linux/i386/lib/libboost_regex.a -L/opt/cm-build/lib /opt/cm-build/lib/libQt5Widgets.a -L/home/aland/src/LSE7/ThirdParty/Qt_5_5/linux/i386/static/lib /opt/cm-build/lib/libQt5WebKit.a -lXcomposite -lxslt -lgio-2.0 -lgstapp-0.10 -lgstinterfaces-0.10 -lgstpbutils-0.10 -lgstvideo-0.10 -lgstbase-0.10 -lgstreamer-0.10 -lgobject-2.0 -lgmodule-2.0 -lxml2 -lsqlite3 -lQt5Sensors -lQt5Positioning -lQt5Sql -lQt5Network /opt/cm-build/lib/libQt5Gui.a /opt/cm-build/lib/libQt5Network.a -lssl -lcrypto /opt/cm-build/lib/libQt5Core.a /opt/cm-build/plugins/platforms/libqxcb.a -lQt5XcbQpa -lX11-xcb -lXi -lxcb -L/home/build-lnx/src/qt-everywhere-enterprise-src-5.5.0/qtbase/src/plugins/platforms/xcb/xcb-static -lxcb-static -lQt5PlatformSupport -lfontconfig -lfreetype -lXrender -lXext -lX11 -ludev -lQt5DBus -ldbus-1 -lQt5Gui -lpng -lqtharfbuzzng -lQt5Core -lz -licui18n -licuuc -licudata -lqtpcre -lm -ldl -pthread -lgthread-2.0 -lrt -lglib-2.0 -lGL -lpthread
    ../../_build/LinuxX86/release/layoutserver/LayoutServer.o: In function LayoutServer::closeEvent(QCloseEvent*)': LayoutServer.cpp:(.text+0x254): undefined reference toLayoutServer::staticMetaObject'
    ../../_build/LinuxX86/release/layoutserver/LayoutServer.o: In function LayoutServer::createActions()': LayoutServer.cpp:(.text+0x3ac): undefined reference toLayoutServer::staticMetaObject'
    LayoutServer.cpp:(.text+0x437): undefined reference to LayoutServer::staticMetaObject' LayoutServer.cpp:(.text+0x500): undefined reference toLayoutServer::staticMetaObject'
    LayoutServer.cpp:(.text+0x5ad): undefined reference to LayoutServer::staticMetaObject' ../../_build/LinuxX86/release/layoutserver/LayoutServer.o: In functionLayoutServer::~LayoutServer()':
    LayoutServer.cpp:(.text+0x9c4): undefined reference to vtable for LayoutServer' ../../_build/LinuxX86/release/layoutserver/LayoutServer.o: In functionLayoutServer::LayoutServer(unsigned short, QWidget*, QFlagsQt::WindowType)':
    LayoutServer.cpp:(.text+0x1567): undefined reference to vtable for LayoutServer' LayoutServer.cpp:(.text+0x18fd): undefined reference tovtable for AboutDialog'
    ../../_build/LinuxX86/release/layoutserver/LayoutServer.o: In function LayoutServer::start_accept()': LayoutServer.cpp:(.text+0x1fb0): undefined reference toLayoutServer::createNewRenderer()'
    ../../_build/LinuxX86/release/layoutserver/main.o: In function LayoutServerApp::~LayoutServerApp()': main.cpp:(.text._ZN15LayoutServerAppD2Ev[_ZN15LayoutServerAppD5Ev]+0x1c): undefined reference tovtable for LayoutServerApp'
    ../../_build/LinuxX86/release/layoutserver/main.o: In function LayoutServerApp::~LayoutServerApp()': main.cpp:(.text._ZN15LayoutServerAppD0Ev[LayoutServerApp::~LayoutServerApp()]+0x2c): undefined reference tovtable for LayoutServerApp'
    ../../_build/LinuxX86/release/layoutserver/main.o: In function main': main.cpp:(.text.startup+0x32): undefined reference toqInitResources_layoutserver()'
    main.cpp:(.text.startup+0x6a): undefined reference to vtable for LayoutServerApp' ../../_build/LinuxX86/release/layoutserver/LayoutServerConnection.o: In functionLayoutServerConnection::handle_read(boost::system::error_code const&, unsigned int)':
    LayoutServerConnection.cpp:(.text+0xaec): undefined reference to LayoutRendererHandler::blocking_render(Request_render const&)' LayoutServerConnection.cpp:(.text+0xd3a): undefined reference toLayoutRendererHandler::blocking_hitTest(Request_hitTest const&)'
    LayoutServerConnection.cpp:(.text+0xf5e): undefined reference to LayoutRendererHandler::blocking_loadTemplate(Request_loadTemplate const&)' ../../_build/LinuxX86/release/layoutserver/LayoutRendererHandler.o: In functionLayoutRendererHandler::LayoutRendererHandler()':
    LayoutRendererHandler.cpp:(.text+0x37): undefined reference to vtable for LayoutRendererHandler' ../../_bin/LinuxX86/liblayoutrenderer.a(html2bitmap.o): In functionCHtml2Bitmap::load()':
    html2bitmap.cpp:(.text+0x390): undefined reference to QWebPage::setViewportSize(QSize const&) const' html2bitmap.cpp:(.text+0x3b4): undefined reference toQWebPage::mainFrame() const'
    html2bitmap.cpp:(.text+0x3cc): undefined reference to QWebFrame::setScrollBarPolicy(Qt::Orientation, Qt::ScrollBarPolicy)' html2bitmap.cpp:(.text+0x3d4): undefined reference toQWebPage::mainFrame() const'
    html2bitmap.cpp:(.text+0x3ec): undefined reference to QWebFrame::setScrollBarPolicy(Qt::Orientation, Qt::ScrollBarPolicy)' html2bitmap.cpp:(.text+0x3f4): undefined reference toQWebPage::mainFrame() const'
    html2bitmap.cpp:(.text+0x400): undefined reference to QWebFrame::load(QUrl const&)' ../../_bin/LinuxX86/liblayoutrenderer.a(html2bitmap.o): In functionCHtml2Bitmap::setConfig(CHtml2BitmapParams const&)':
    html2bitmap.cpp:(.text+0x5f4): undefined reference to CHtml2Bitmap::staticMetaObject' html2bitmap.cpp:(.text+0x654): undefined reference toCHtml2Bitmap::staticMetaObject'
    html2bitmap.cpp:(.text+0x69c): undefined reference to CHtml2Bitmap::staticMetaObject' html2bitmap.cpp:(.text+0x6e4): undefined reference toCHtml2Bitmap::staticMetaObject'
    html2bitmap.cpp:(.text+0x72c): undefined reference to CHtml2Bitmap::staticMetaObject' ../../_bin/LinuxX86/liblayoutrenderer.a(html2bitmap.o):html2bitmap.cpp:(.text+0x774): more undefined references toCHtml2Bitmap::staticMetaObject' follow
    ../../_bin/LinuxX86/liblayoutrenderer.a(html2bitmap.o): In function CHtml2Bitmap::renderPageToImage(QImage&, int&, int&, QString const&, QPoint const&, QString&)': html2bitmap.cpp:(.text+0xd85): undefined reference toQWebPage::mainFrame() const'
    html2bitmap.cpp:(.text+0xe58): undefined reference to QWebFrame::evaluateJavaScript(QString const&)' html2bitmap.cpp:(.text+0xec3): undefined reference toQWebFrame::contentsSize() const'
    html2bitmap.cpp:(.text+0xf1b): undefined reference to CHtml2Bitmap::staticMetaObject' html2bitmap.cpp:(.text+0xfb4): undefined reference toQWebPage::viewportSize() const'
    html2bitmap.cpp:(.text+0xfcf): undefined reference to QWebPage::viewportSize() const' html2bitmap.cpp:(.text+0xff1): undefined reference toQWebPage::viewportSize() const'
    html2bitmap.cpp:(.text+0x10fd): undefined reference to QWebFrame::render(QPainter*, QRegion const&)' html2bitmap.cpp:(.text+0x1336): undefined reference toQWebFrame::hitTestContent(QPoint const&) const'
    html2bitmap.cpp:(.text+0x1348): undefined reference to QWebHitTestResult::isNull() const' html2bitmap.cpp:(.text+0x136a): undefined reference toQWebHitTestResult::element() const'
    html2bitmap.cpp:(.text+0x13d2): undefined reference to QWebElement::attribute(QString const&, QString const&) const' html2bitmap.cpp:(.text+0x141a): undefined reference toQWebElement::parent() const'
    html2bitmap.cpp:(.text+0x147e): undefined reference to QWebElement::~QWebElement()' html2bitmap.cpp:(.text+0x148d): undefined reference toQWebElement::~QWebElement()'
    html2bitmap.cpp:(.text+0x14a1): undefined reference to QWebHitTestResult::~QWebHitTestResult()' html2bitmap.cpp:(.text+0x14d4): undefined reference toCHtml2Bitmap::staticMetaObject'
    html2bitmap.cpp:(.text+0x153d): undefined reference to CHtml2Bitmap::staticMetaObject' html2bitmap.cpp:(.text+0x15db): undefined reference toQWebElement::isNull() const'
    html2bitmap.cpp:(.text+0x15fd): undefined reference to QWebElement::operator=(QWebElement const&)' html2bitmap.cpp:(.text+0x1655): undefined reference toQWebElement::attribute(QString const&, QString const&) const'
    html2bitmap.cpp:(.text+0x169d): undefined reference to QWebElement::parent() const' html2bitmap.cpp:(.text+0x16b3): undefined reference toQWebElement::operator=(QWebElement const&)'
    html2bitmap.cpp:(.text+0x16bb): undefined reference to QWebElement::~QWebElement()' html2bitmap.cpp:(.text+0x16d4): undefined reference toCHtml2Bitmap::staticMetaObject'
    html2bitmap.cpp:(.text+0x17c8): undefined reference to QWebHitTestResult::~QWebHitTestResult()' html2bitmap.cpp:(.text+0x189c): undefined reference toQWebElement::~QWebElement()'
    html2bitmap.cpp:(.text+0x18ab): undefined reference to QWebElement::~QWebElement()' html2bitmap.cpp:(.text+0x193a): undefined reference toQWebElement::~QWebElement()'
    ../../_bin/LinuxX86/liblayoutrenderer.a(html2bitmap.o): In function CHtml2Bitmap::render(Img24Bit&, int&, int&, QString const&)': html2bitmap.cpp:(.text+0x1ad2): undefined reference toCHtml2Bitmap::staticMetaObject'
    html2bitmap.cpp:(.text+0x1b54): undefined reference to CHtml2Bitmap::staticMetaObject' html2bitmap.cpp:(.text+0x1bac): undefined reference toCHtml2Bitmap::staticMetaObject'
    ../../_bin/LinuxX86/liblayoutrenderer.a(html2bitmap.o): In function CHtml2Bitmap::hitTest(QString const&, QPoint const&, QString&)': html2bitmap.cpp:(.text+0x1d74): undefined reference toCHtml2Bitmap::staticMetaObject'
    html2bitmap.cpp:(.text+0x1dcc): undefined reference to CHtml2Bitmap::staticMetaObject' ../../_bin/LinuxX86/liblayoutrenderer.a(html2bitmap.o):html2bitmap.cpp:(.text+0x1eda): more undefined references toCHtml2Bitmap::staticMetaObject' follow
    ../../_bin/LinuxX86/liblayoutrenderer.a(html2bitmap.o): In function CHtml2Bitmap::cancelRender()': html2bitmap.cpp:(.text+0x1f67): undefined reference toCHtml2Bitmap::finished()'
    ../../_bin/LinuxX86/liblayoutrenderer.a(html2bitmap.o): In function CHtml2Bitmap::~CHtml2Bitmap()': html2bitmap.cpp:(.text+0x212a): undefined reference tovtable for CHtml2Bitmap'
    html2bitmap.cpp:(.text+0x2204): undefined reference to vtable for NonInteractiveWebPage' html2bitmap.cpp:(.text+0x2212): undefined reference toQWebPage::~QWebPage()'
    html2bitmap.cpp:(.text+0x224d): undefined reference to vtable for NonInteractiveWebPage' html2bitmap.cpp:(.text+0x225f): undefined reference toQWebPage::~QWebPage()'
    ../../_bin/LinuxX86/liblayoutrenderer.a(html2bitmap.o): In function CHtml2Bitmap::CHtml2Bitmap()': html2bitmap.cpp:(.text+0x2304): undefined reference tovtable for CHtml2Bitmap'
    html2bitmap.cpp:(.text+0x2320): undefined reference to QWebPage::QWebPage(QObject*)' html2bitmap.cpp:(.text+0x2326): undefined reference tovtable for NonInteractiveWebPage'
    html2bitmap.cpp:(.text+0x2444): undefined reference to vtable for NonInteractiveWebPage' html2bitmap.cpp:(.text+0x2456): undefined reference toQWebPage::~QWebPage()'
    ../../_bin/LinuxX86/liblayoutrenderer.a(html2bitmap.o): In function CHtml2Bitmap::onLoadFinished(bool)': html2bitmap.cpp:(.text+0x24c7): undefined reference toCHtml2Bitmap::staticMetaObject'
    html2bitmap.cpp:(.text+0x2557): undefined reference to QWebPage::settings() const' html2bitmap.cpp:(.text+0x255c): undefined reference toQWebSettings::clearMemoryCaches()'
    html2bitmap.cpp:(.text+0x2564): undefined reference to CHtml2Bitmap::finished()' collect2: ld returned 1 exit status make[1]: *** [../../_bin/LinuxX86/layoutserver] Error 1 make[1]: Leaving directory/home/aland/src/LSE7/Applications/LayoutServer'
    make: *** [release] Error 2



  • All of the above seem to be components in QtWebKitWidgets.

    I did add that to the project to link in, but they still come up unresovled.

    Hmmmm...



  • One other question. Let's say I wanted to build my own shared version to install into /usr/

    Would it be possible to put a unique prefix on my shared libraries so they wouldn't conflict with the standard Qt5 libs? Would it be possible to name all the libraries with a prefix of say Xy so that all libs would be called libXyQt5Gui.so (as an example using Gui) ???



  • here's another app, and this seems that because uic and moc is not running, it's missing some meta object data...

    I ran uic manually to get the header needed, but do I need to run moc also?

    Why are these not being called from my project anymore I wonder?

    g++ -Wl,-O1 -o ../../_bin/LinuxX86/biobasetestapp ../../_build/LinuxX86/release/BioBaseTestApp/logbrowser.o ../../_build/LinuxX86/release/BioBaseTestApp/StringConvert.o ../../_build/LinuxX86/release/BioBaseTestApp/biob_defs_common.o ../../_build/LinuxX86/release/BioBaseTestApp/BioBaseTestApp.o ../../_build/LinuxX86/release/BioBaseTestApp/CallBackLogObj.o ../../_build/LinuxX86/release/BioBaseTestApp/CallBackModel.o ../../_build/LinuxX86/release/BioBaseTestApp/CallBackTreeItem.o ../../_build/LinuxX86/release/BioBaseTestApp/ControlData.o ../../_build/LinuxX86/release/BioBaseTestApp/DevicePropertiesDomModel.o ../../_build/LinuxX86/release/BioBaseTestApp/DevicesInfoDomModel.o ../../_build/LinuxX86/release/BioBaseTestApp/DynLoadDll_BioBase.o ../../_build/LinuxX86/release/BioBaseTestApp/RegisteredCallBackModel.o ../../_build/LinuxX86/release/BioBaseTestApp/main.o ../../_build/LinuxX86/release/BioBaseTestApp/stdafx.o -L/home/aland/src/LSE7/_Globals/Properties/../../ThirdParty/boost_1_57_0/linux/i386/lib -L../../_bin/LinuxX86 -ldynamicloader -lthreadpool -lCMTfinger -lX11 -L../../ThirdParty/boost_1_57_0/linux/i386/lib ../../ThirdParty/boost_1_57_0/linux/i386/lib/libboost_thread.a ../../ThirdParty/boost_1_57_0/linux/i386/lib/libboost_regex.a ../../ThirdParty/boost_1_57_0/linux/i386/lib/libboost_system.a -L/opt/cm-build/lib /opt/cm-build/lib/libQt5Widgets.a -lQt5Gui /opt/cm-build/lib/libQt5Gui.a -lpng -lqtharfbuzzng -lGL /opt/cm-build/lib/libQt5Xml.a -lQt5Core /opt/cm-build/lib/libQt5Core.a -lz -licui18n -licuuc -licudata -lqtpcre -lm -ldl -pthread -lgthread-2.0 -lrt -lglib-2.0 -lpthread
    ../../_build/LinuxX86/release/BioBaseTestApp/logbrowser.o: In function LogBrowser::LogBrowser(QWidget*)': logbrowser.cpp:(.text+0x2c): undefined reference tovtable for LogBrowser'
    logbrowser.cpp:(.text+0x49): undefined reference to LogBrowser::staticMetaObject' ../../_build/LinuxX86/release/BioBaseTestApp/logbrowser.o: In functionLogBrowser::~LogBrowser()':
    logbrowser.cpp:(.text+0x1b5): undefined reference to vtable for LogBrowser' ../../_build/LinuxX86/release/BioBaseTestApp/logbrowser.o: In functionLogBrowser::appendLogText(QString const&)':
    logbrowser.cpp:(.text+0x2dc): undefined reference to LogBrowser::newLogText(QString)' ../../_build/LinuxX86/release/BioBaseTestApp/BioBaseTestApp.o: In functionBioBaseTestApp::OnBtnBioBSetPropertiesClicked()':
    BioBaseTestApp.cpp:(.text+0x2ef4): undefined reference to BioBaseTestApp::staticMetaObject' BioBaseTestApp.cpp:(.text+0x2f41): undefined reference toBioBaseTestApp::staticMetaObject'
    ../../_build/LinuxX86/release/BioBaseTestApp/BioBaseTestApp.o: In function BioBaseTestApp::OnBtnLEDRemove()': BioBaseTestApp.cpp:(.text+0x9834): undefined reference toBioBaseTestApp::staticMetaObject'
    ../../_build/LinuxX86/release/BioBaseTestApp/BioBaseTestApp.o: In function BioBaseTestApp::Static_ScannerUserOutput(wchar_t const*, void const*, BioBSetOutputData const*)': BioBaseTestApp.cpp:(.text+0x9c00): undefined reference toBioBaseTestApp::pixMapChanged()'
    ../../_build/LinuxX86/release/BioBaseTestApp/BioBaseTestApp.o: In function BioBaseTestApp::Static_DataAvailable(wchar_t const*, void const*, int, BioBData const*, int)': BioBaseTestApp.cpp:(.text+0xa1e2): undefined reference toBioBaseTestApp::pixMapChanged()'
    ../../_build/LinuxX86/release/BioBaseTestApp/BioBaseTestApp.o: In function BioBaseTestApp::Static_Preview(wchar_t const*, void const*, BioBData const*)': BioBaseTestApp.cpp:(.text+0xa398): undefined reference toBioBaseTestApp::pixMapChanged()'
    ../../_build/LinuxX86/release/BioBaseTestApp/BioBaseTestApp.o: In function BioBaseTestApp::~BioBaseTestApp()': BioBaseTestApp.cpp:(.text+0xb3c8): undefined reference tovtable for BioBaseTestApp'
    ../../_build/LinuxX86/release/BioBaseTestApp/BioBaseTestApp.o: In function BioBaseTestApp::OnBtnFileSelectClicked()': BioBaseTestApp.cpp:(.text+0xebcc): undefined reference toBioBaseTestApp::staticMetaObject'
    BioBaseTestApp.cpp:(.text+0xec02): undefined reference to BioBaseTestApp::staticMetaObject' ../../_build/LinuxX86/release/BioBaseTestApp/BioBaseTestApp.o: In functionBioBaseTestApp::BioBaseTestApp(QWidget*, QFlagsQt::WindowType)':
    BioBaseTestApp.cpp:(.text+0x106f9): undefined reference to vtable for BioBaseTestApp' ../../_build/LinuxX86/release/BioBaseTestApp/CallBackModel.o: In functionCallBackModel::CallBackModel(QObject*)':
    CallBackModel.cpp:(.text+0x14c): undefined reference to vtable for CallBackModel' ../../_build/LinuxX86/release/BioBaseTestApp/CallBackModel.o: In functionCallBackModel::~CallBackModel()':
    CallBackModel.cpp:(.text+0x18c): undefined reference to vtable for CallBackModel' ../../_build/LinuxX86/release/BioBaseTestApp/DevicePropertiesDomModel.o: In functionDevicePropertiesDomModel::DevicePropertiesDomModel(QDomDocument, QObject*)':
    DevicePropertiesDomModel.cpp:(.text+0x28): undefined reference to vtable for DevicePropertiesDomModel' ../../_build/LinuxX86/release/BioBaseTestApp/DevicePropertiesDomModel.o: In functionDevicePropertiesDomModel::DevicePropertiesDomModel(QObject*)':
    DevicePropertiesDomModel.cpp:(.text+0x1fc): undefined reference to vtable for DevicePropertiesDomModel' ../../_build/LinuxX86/release/BioBaseTestApp/DevicePropertiesDomModel.o: In functionDevicePropertiesDomModel::~DevicePropertiesDomModel()':
    DevicePropertiesDomModel.cpp:(.text+0x25c): undefined reference to vtable for DevicePropertiesDomModel' ../../_build/LinuxX86/release/BioBaseTestApp/DevicePropertiesDomModel.o: In functionDevicePropertiesDomModel::headerData(int, Qt::Orientation, int) const':
    DevicePropertiesDomModel.cpp:(.text+0x884): undefined reference to DevicePropertiesDomModel::staticMetaObject' DevicePropertiesDomModel.cpp:(.text+0x90d): undefined reference toDevicePropertiesDomModel::staticMetaObject'
    ../../_build/LinuxX86/release/BioBaseTestApp/DevicesInfoDomModel.o: In function DevicesInfoDomModel::DevicesInfoDomModel(QDomDocument, QObject*)': DevicesInfoDomModel.cpp:(.text+0x28): undefined reference tovtable for DevicesInfoDomModel'
    ../../_build/LinuxX86/release/BioBaseTestApp/DevicesInfoDomModel.o: In function DevicesInfoDomModel::DevicesInfoDomModel(QObject*)': DevicesInfoDomModel.cpp:(.text+0x1fc): undefined reference tovtable for DevicesInfoDomModel'
    ../../_build/LinuxX86/release/BioBaseTestApp/DevicesInfoDomModel.o: In function DevicesInfoDomModel::~DevicesInfoDomModel()': DevicesInfoDomModel.cpp:(.text+0x25c): undefined reference tovtable for DevicesInfoDomModel'
    ../../_build/LinuxX86/release/BioBaseTestApp/DevicesInfoDomModel.o: In function DevicesInfoDomModel::headerData(int, Qt::Orientation, int) const': DevicesInfoDomModel.cpp:(.text+0x158e): undefined reference toDevicesInfoDomModel::staticMetaObject'
    DevicesInfoDomModel.cpp:(.text+0x1614): undefined reference to DevicesInfoDomModel::staticMetaObject' DevicesInfoDomModel.cpp:(.text+0x1684): undefined reference toDevicesInfoDomModel::staticMetaObject'
    DevicesInfoDomModel.cpp:(.text+0x16fc): undefined reference to DevicesInfoDomModel::staticMetaObject' ../../_build/LinuxX86/release/BioBaseTestApp/RegisteredCallBackModel.o: In functionRegisteredCallBackModel::~RegisteredCallBackModel()':
    RegisteredCallBackModel.cpp:(.text+0x23): undefined reference to vtable for RegisteredCallBackModel' ../../_build/LinuxX86/release/BioBaseTestApp/RegisteredCallBackModel.o: In functionRegisteredCallBackModel::setCallBackHighlighted(std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, bool)':
    RegisteredCallBackModel.cpp:(.text+0x139d): undefined reference to RegisteredCallBackModel::updateList()' ../../_build/LinuxX86/release/BioBaseTestApp/RegisteredCallBackModel.o: In functionRegisteredCallBackModel::RegisteredCallBackModel(QObject*)':
    RegisteredCallBackModel.cpp:(.text+0x15fc): undefined reference to vtable for RegisteredCallBackModel' collect2: ld returned 1 exit status make[2]: *** [../../_bin/LinuxX86/biobasetestapp] Error 1 make[2]: Leaving directory/home/aland/src/LSE7/Applications/BioBaseTestApp'
    make[1]: *** [release] Error 2
    make[1]: Leaving directory `/home/aland/src/LSE7/Applications/BioBaseTestApp'
    make: *** [sub----------Applications-BioBaseTestApp-BioBaseTestApp-pro-make_first] Error 2
    [aland@oak-32 LSCAN_Essentials]$


  • Lifetime Qt Champion

    Did you build the tools ?

    Not prefix but infix, take a look at the -qtlibinfix option of configure

    Don't forget that if you re-configure Qt you need to rebuild from scratch



  • @SGaist Yes, I built the tools and am using qmake from the bin dir. I have modified the environment with QMAKESPEC and pathing in the bin dir to allow it to run successfully.

    Does that last link look like it's missing some of the meta object information to you?

    I wasn't sure what takes place during the make process, I have seen both uic and moc running but wasn't sure of the order and/or if other stuff runs. Clearly uic is not running as I had to run it myself to produce the ui_header.h file(s).

    I've seen a lot of bugs where uic doesn't run when people replace Qt with their own.

    In the past I've never had that problem on Linux as I just put my shared libs in /usr and the libraries ended up in /usr/lib, but I'm not sure that would be good for an app that ships. We're using Ubuntu 12.04, which doesn't have any Qt5 packages, but if someone added them to their system we stand the chance to overwrite their libraries with ours if we install to /usr.

    I have also read that there are some exports, so renaming the libs is not a long term solution.


  • Lifetime Qt Champion

    I don't know what is happening to you, exporting the QMAKESPEC is not something that should be needed at all. Another silly question: did you run make install ?

    When deploying such an app you should not put anything in /usr/lib. You should rather have your package in an known folder that will also contain Qt and a link in e.g. /usr/bin or rather /usr/local/bin, add @origin to the rpath when building so your application will search for Qt in the same folder as it is.



  • @SGaist I just wanted to make the QMAKESPEC specific. I have since moved back to a shared build, as I had problems linking statically with some of the Boost libraries, and the Boost libraries had a couple problems compiled as static. The solution was to set the rpath into the binaries and shared libs to point to my directory I put in /opt.

    I have things all worked out now. I'm sure I have clean builds that go into /opt, and I have both architectures packaged up in Debian packages. I include both architectures in each respective .deb package.

    I've set the rpath in all my binaries and shared libs to point to my /opt/xxxx/i386/lib or /opt/xxxx/x86_64/lib for the respective architecture.

    I haven't tested yet, but my main shared library is in /usr/lib, and that is what developers will link to. That shared library has the rpath set to /opt/xxxx/<arch>/lib, so I think the developed applications should resolve without having to add the rpath to the build. That will be easier for developers. This means that developers will not need to change their environment at all and can just include my main lib I placed in /usr/lib with -l in their LIBS statement.

    I was able to get all my packages built and installed to /opt/xxxx which is my entire Qt 5.5.1 build along with a couple other dependencies. I was going to use /usr/local, but typically that's for locally built packages, and /opt is a better location for this stuff, IMO. This means that no LD_LIBRARY_PATH b#!!$HITery is needed, nor any ld.so.conf @$$#atery...

    I'm distributing for Ubuntu 12.04.5, which doesn't have Qt5 available by default, although Ubuntu has a ppa to add for Qt5 packages, they don't have all of them and don't have Qt5X11Extras which I needed. I didn't want to run the risk of putting this stuff in /usr to have a conflict with other Qt5 libs that might be compiled differently. Now mine are solely in /opt and should not conflict with anything else.

    All of the .deb packages install and everything seems to run fine. :-)

    Thanks for your help...sorry for the slow response, I've been burning the candle at both ends getting our new release compiled and packaged properly, and had to setup build servers for 32-bit and 64-bit as well. Everything is automated and builds cleanly.

    NOTE: I will add this tidbit of information that took me quite a while to figure out in the qmake projects, how to differentiate between architecture to be able to include different compile and/or link options. The way it is documented doesn't work correctly. This is what I use. I only need to worry about 32-bit and 64-bit for Intel architecture.

    Platform = $$QMAKE_HOST.arch
    contains(Platform, i686 ) {
    # 32-bit
    }else{
    # 64-bit
    }
    

    [edit: Added missing coding tags ``` SGaist]


  • Lifetime Qt Champion

    No problem, the essential point is that you could go further correctly :)

    That's strange, what value are you getting for 64 bit ?



  • @SGaist I get x86_64 on 64-bit. I thought it odd that 32-bit give i686 rather than i386. On ubuntu the architecture is i386 for 32-bit and amd64 for 64-bit packages.

    BTW, I notice something odd, in that it seems to require my .qt-license to use the tools. Is it required that I need to distribute my license with my build of Qt5 do you know?

    I compiled the Enterprise edition, and compiled a commercial (not an opensource) version.

    Seems odd that they would need a license for the distribution.


  • Lifetime Qt Champion

    That's a naming convention like arm/armel both run on arm but have a different ABI.

    i686 is the P6 generation of Intel's 32bit architecture



  • Yeah, but in the docs that is not how they tell you to check for architecture. I can't remember off the top of my head, but the way they show doesn't work for me. What i have above works, at least on Ubuntu 12.04.

    I switched back to an opensource compile rather than commercial as I am not sure I can redistribute the commercial build for developers to use on my current Silver license. I'm waiting for QT to get back to me so I can better understand that.


  • Lifetime Qt Champion

    The doc shows an example that makes use of QMAKE_HOST.arch with the win32-g++ scope. Just remove that scope and it should work.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.