Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. static library

    Log in to post
    • All categories
    • F

      Solved console.log() or debug() etc. prints nothing to console from static library (QtCreator)
      QML and Qt Quick • static library qml debug libraries console.log • • flux

      5
      0
      Votes
      5
      Posts
      1708
      Views

      F

      OK I did it. As I assumed the third party librarie has a deep impact of the QDebug-Infrastructure and catches all messages after the first time the library is used.

      There was no need to configure in QtCreator or something else except in the config of these other libraries. Now I get the messages back in the IDE Application Output.

      I hope that will help other poeple finding debugging problems.

    • A

      Unsolved Warning: QObject::startTimer: Timers can only be used with threads started with QThread
      General and Desktop • qt 5.12 qtimer shared library qthread static library • • adw0022

      2
      0
      Votes
      2
      Posts
      1232
      Views

      Christian Ehrlicher

      Install a Qt message handler, set a breakpoint in there and take a look at the backtrace where it comes from.

    • H

      Unsolved Static Build and Qml
      Installation and Deployment • qml static library circulargauge • • hansob3

      3
      0
      Votes
      3
      Posts
      535
      Views

      H

      I have included the import statement. I have my project being built two ways. I have it setup as using shared libs while debugging so I have a kit that is set up for that using the default qt install. I then have a static kit that I use for release.

      When I run the debug it loads fine, I get no errors. When I switch to the release kit I then get the error that you posted about an unknown component.

      Here is my qml file

      import QtQuick 2.12 import QtQuick.Window 2.12 import QtQuick.Extras 1.4 import QtQuick.Controls.Styles 1.4 Window { visible: true width: 640 height: 480 title: qsTr("Hello World") CircularGauge { id: gauge width: 400 height: 400 antialiasing: true tickmarksVisible: true anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter value: 0 minimumValue: -100 maximumValue: 100 style: CircularGaugeStyle { minorTickmarkCount: 0 needle: Rectangle { y: outerRadius * 0.15 implicitWidth: outerRadius * 0.03 implicitHeight: outerRadius * 0.9 antialiasing: true color: Qt.rgba(0.66, 0.3, 0, 1) } } } }

      I just used the basic Qt Quick Application - Empty template for the project and only added

      CONFIG += static

      to the .pro file

      For some reason it's not finding the Controls.Styles using the static build. If I mouse over the import statement it reads 'Library at C:/Qt/Static/5.12.3/qml/QtQuick/Controls/Styles'.

    • P

      Unsolved Win32 static linking?
      QML and Qt Quick • qml static library win32 msvc2017 32bit • • pderocco

      12
      0
      Votes
      12
      Posts
      2772
      Views

      P

      @SGaist said in Win32 static linking?:

      Qt Creator architecture has nothing to do with the architecture of your application.

      To build a 32bit version of your application, use the 32bit package for MSVC2017. The same goes for the 64bit version.

      Yeah, that worked. When I tried it in 5.12.0 and failed, there must have been something misconfigured.

      I currently don't know for the static version, however when building the dynamic version you can say to configure that it should build dynamic backend selection.

      Following some info from another post, I tried the following configure.bat options:

      -prefix "C:\Qt\Qt5.12.2\5.12.2\msvc2017sr" -release -platform win32-msvc -confirm-license -opensource -nomake examples -nomake tests -static -static-runtime -opengl dynamic -angle -combined-angle-lib -no-feature-d3d12

      Now it works on the 32-bit Windows machine I used to build Qt and the application (and still works fine on the 64-bit machine I can also build it on), but when I run it on another Win7 64-bit machine that has never had Qt installed on it, I just get the window frame again. Is it looking for a DLL? I only have a nebulous idea of what some of those configure options actually mean, so I don't know what to try next.

    • E

      Solved Linking static library to an executable
      General and Desktop • static library static linking executable qmake • • enmaniac

      11
      0
      Votes
      11
      Posts
      24864
      Views

      kshegunov

      No problem. Good luck with your project!

    • Dong

      Unsolved Compile Error: "Undefined reference to" Constructor
      General and Desktop • compile-error static library constructor • • Dong

      12
      0
      Votes
      12
      Posts
      24794
      Views

      Dong

      Dear All: here is my situation

      The class which cause compile Error is PropertyColumnMapping in DynamicObjectCore.pro Then CommonBusiness.pro using this class And Presentation linked to both CommonBusiness.pro & DynamicObjectCore.pro

      Clean + QMake + Rebuild doesn't work.

      Here is my Project Structure.

      Application.pro
      TEMPLATE = subdirs
      CONFIG += ordered

      SUBDIRS +=
      Framework
      Services
      Business
      Presentation
      Updater

      QT += qml quick widgets network sql xml

      Business.pro
      TEMPLATE = subdirs

      SUBDIRS +=
      CommonBusiness
      ServiceBusiness

      //Link to Framework.System

      CommonBusiness.pro
      QT -= gui
      QT += qml quick sql xml xmlpatterns network

      TARGET = CommonBusiness
      TEMPLATE = lib
      CONFIG += staticlib c++11

      SOURCES += commonbusiness.cpp
      ...

      HEADERS += commonbusiness.h
      ...

      //# Link to FrameWork.DynamicObjectCore

      DynamicObjectCore.pro
      QT -= gui
      QT += qml

      TARGET = DynamicObjectCore
      TEMPLATE = lib
      CONFIG += staticlib c++11
      #DEFINES += DYNAMICOBJECTCORE_LIBRARY

      SOURCES +=
      MetadataModel/propertycolumnmapping.cpp
      ...

      HEADERS +=
      MetadataModel/propertycolumnmapping.h
      ...
      unix {
      target.path = /usr/lib
      INSTALLS += target
      }

      Presentation.pro
      TEMPLATE = app

      TARGET = [ApplicationName]

      QT += qml quick widgets network sql xml xmlpatterns

      //# for QT 5.4
      qtHaveModule(webengine) {
      QT += webengine
      DEFINES += QT_WEBVIEW_WEBENGINE_BACKEND
      }

      qtHaveModule(webkitwidgets) {
      QT += webkitwidgets
      }

      //# for QT 5.7
      equals(QT_VERSION, QT_VERSION_CHECK(5, 7, 0)) {
      QT += webview
      DEFINES += QT_WEBVIEW_CONTROL_BACKEND
      }

      CONFIG += c++11

      CONFIG(release, debug|release) {
      CONFIG += release force_debug_info
      }
      RESOURCES += qml.qrc
      shared.qrc

      //# Link to DynamicObjectCore
      //# Link to CommonBusiness

    • Simon Platten

      Unsolved Building Qt as static libraries and linking on RedHat 7.2
      Mobile and Embedded • static library static linking • • Simon Platten

      17
      0
      Votes
      17
      Posts
      4606
      Views

      kshegunov

      @SGaist
      This is so new and fresh, I love it. I'll consider making a few pull requests in the near future. :)

    • J

      Unsolved Build non-QT C++ static library using QT
      Installation and Deployment • static library deploy ios android • • julianoes

      11
      0
      Votes
      11
      Posts
      6781
      Views

      SGaist

      Then there might be something I'm missing about your current setup.

      In any case, take a look at this excellent blog article about that subject. That should give you the clues needed to solve your situation.

    • T

      Unsolved Need help linking against static FORTRAN library
      General and Desktop • visual fortran static library • • towtruck

      5
      0
      Votes
      5
      Posts
      1853
      Views

      T

      Thank You!

      Not a silly question.

      Actually, I upgraded my version of VS from 2012 to 2013 to go with Qt for MSVC2013. Otherwise, I wouldn't even be able to compile pure C++ with Qt, which I have had no problem doing. I just can't seem to create even a pure C++ library in VS OR Qt, and have Qt recognize it. That will be my challenge in the next days, and is understandably slightly off-topic for this thread. But I will definitely report back.

      Thanks to all!

    • M

      Solved Static members in static library
      General and Desktop • static library static method linker • • Mark81

      6
      0
      Votes
      6
      Posts
      1400
      Views

      kshegunov

      @Mark81
      No problem.

    • Z

      Solved How can I make a static build of Qt's libraries available to Creator?
      Tools • static library static linking creator • • ZeBe

      4
      0
      Votes
      4
      Posts
      1295
      Views

      Z

      I'll try that, thanks for the help.

    • M

      Solved How to load translation for static library widget
      General and Desktop • qtranslator static library • • mbnoimi

      32
      0
      Votes
      32
      Posts
      10732
      Views

      mrjj

      @mbnoimi
      Ok, why if I can ask?

    • P

      Unsolved "undefined reference to 'qt_static_plugin_AccessibleFactory()'" for static Qt build during exe build
      General and Desktop • static build plugins static library • • pditty8811

      3
      0
      Votes
      3
      Posts
      1398
      Views

      P

      Does anyone have instructions for Qt static build that is version 5.4 or greater?

    • J

      "Undefined symbols for arch. i386" when including C++ library in iOS simulator build
      Mobile and Embedded • ios static library c++ mac • • jonei

      2
      0
      Votes
      2
      Posts
      1802
      Views

      J

      So I finally found a part in the documentation saying:

      PRE_TARGETDEPS
      Lists libraries that the target depends on. Some backends, such as the generators for Visual Studio and Xcode project files, do not support this variable. Generally, this variable is supported internally by these build tools, and it is useful for explicitly listing dependent static libraries.

      Apparently I have to include the lib manually in the .xcodeproj file. That worked, but isn't Add Library... supposed to add the necessary commands to the .pro file?

    • K

      Link my Qt static library in to non Qt linux application
      General and Desktop • library static static linking static library 4.8 non-qt • • kumararajas

      3
      0
      Votes
      3
      Posts
      1758
      Views

      K

      But this time, I have a different error:

      /home/kumararajas/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/i686-arago-linux/usr/bin/../lib/gcc/arm-linux-gnueabihf/4.7.3/../../../../arm-linux-gnueabihf/bin/ld: /home/kumararajas/Integrate_UI/G-CPU/lib/libuicorelib.a(uicontroller.o): undefined reference to symbol '__cxa_begin_catch@@CXXABI_1.3' /home/kumararajas/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/i686-arago-linux/usr/bin/../lib/gcc/arm-linux-gnueabihf/4.7.3/../../../../arm-linux-gnueabihf/bin/ld: note: '__cxa_begin_catch@@CXXABI_1.3' is defined in DSO /home/kumararajas/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/i686-arago-linux/usr/bin/../arm-linux-gnueabihf/libc/lib/arm-linux-gnueabihf/libstdc++.so.6 so try adding it to the linker command line /home/kumararajas/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/i686-arago-linux/usr/bin/../arm-linux-gnueabihf/libc/lib/arm-linux-gnueabihf/libstdc++.so.6: could not read symbols: Invalid operation collect2: error: ld returned 1 exit status make[4]: *** [bin/FireApp] Error 1 make[3]: *** [libraries] Error 2 make[2]: *** [libraries] Error 2 make[1]: *** [libraries] Error 2

      This looks like standard library compatibility issue.

      Any thoughts on this?

    • B

      QML application fails to create OpenGL context (Qt 5.5 / msvc 2015 / x64 / static)
      QML and Qt Quick • qml static library windows 7 64 bi virtualbox msvc2015 • • Buck Yeh

      1
      1
      Votes
      1
      Posts
      1926
      Views

      No one has replied

    • T

      Build the dependent statically link libs & set its order
      QML and Qt Quick • static library solution explor • • tushar ramojwar

      3
      0
      Votes
      3
      Posts
      868
      Views

      SGaist

      Hi,

      To add to @koahnig , this article explains very well how to setup dependencies efficiently

    • M

      Mac OSX 10.10 - Include a QT Static Library *.a into a Eclipse CDT JNI Shared Library *jnilib (Download of the projekts available)
      Installation and Deployment • jnilib eclipse cdt jni mac os x eclipse java jni static library shared library • • moozoom

      2
      0
      Votes
      2
      Posts
      1577
      Views

      S

      @moozoom
      I run in the same paradigm when I try to create a static linked library with Qt targeting Android and latter to use it with JINI on Android Studio.
      Reading you post I see you have almost the same problem like me with one difference.
      To me are working as far I use only std library
      My problem appears when I use QString for example in the library.
      Looks the static build does not statically includes the Qt framework dependencies.
      Finally did you find a solution? Me I run with this issue past over one month.
      Thanks

    • M

      Mac OSX QT-Creator Static Library *.a (clang-Compiler) in Eclipse CDT (JNI) *.jnilib (cpp-Compiler) einbinden (Download Projekte)
      German • static eclipse cdt jni clang cpp jnilib mac os x static library eclipse cdt java jni llvm • • moozoom

      1
      0
      Votes
      1
      Posts
      1077
      Views

      No one has replied