Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to configure QT6 static?
Forum Updated to NodeBB v4.3 + New Features

How to configure QT6 static?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
15 Posts 6 Posters 2.7k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H hsjeong
    5 Feb 2024, 02:58

    HI, I am a new beginner of QT6.
    What i want to do is to make an application using QT6 and then deploy it to an embedded linux device which is not going to install QT6 source inside.

    I searched some documents and I found that I had to build my QT6 source by static to deploy my application stand alone.

    Then, I was following this video;
    youtube.com/watch?v=2qsR8Dw8uzA

    AND
    i was trying to use
    $ make -j8
    command
    then, i was stuck with this error message.
    $ make: *** No targets specified and no makefile found. Stop.

    What would be the problem?
    My log is like this;

    -- Configure summary:

    Building for: linux-g++ (x86_64, CPU features: mmx sse sse2)
    Compiler: gcc 11.4.0
    Build options:
    Mode ................................... release
    Optimize release build for size ........ no
    Fully optimize release builds (-O3) .... no
    Building shared libraries .............. no
    Using C standard ....................... C11
    Using C++ standard ..................... C++17
    Using ccache ........................... no
    Unity Build ............................ no
    Using new DTAGS ........................ yes
    Relocatable ............................ no
    Using precompiled headers .............. yes
    Using Link Time Optimization (LTCG) .... no
    Using Intel CET ........................ yes
    Target compiler supports:
    x86 Intrinsics ....................... Basic VAES AVX512VBMI2
    Sanitizers:
    Addresses ............................ no
    Threads .............................. no
    Memory ............................... no
    Fuzzer (instrumentation only) ........ no
    Undefined ............................ no
    Build parts ............................ libs tools
    Qt modules and options:
    Qt Concurrent .......................... yes
    Qt D-Bus ............................... yes
    Qt D-Bus directly linked to libdbus .... yes
    Qt Gui ................................. yes
    Qt Network ............................. yes
    Qt PrintSupport ........................ yes
    Qt Sql ................................. yes
    Qt Testlib ............................. yes
    Qt Widgets ............................. yes
    Qt Xml ................................. yes
    Support enabled for:
    Using pkg-config ....................... yes
    udev ................................... no
    OpenSSL ................................ no
    Qt directly linked to OpenSSL ........ no
    OpenSSL 1.1 ............................ no
    OpenSSL 3.0 ............................ no
    Using system zlib ...................... yes
    Zstandard support ...................... no
    Thread support ......................... yes
    Common build options:
    Linker can resolve circular dependencies yes
    Qt Core:
    backtrace .............................. yes
    DoubleConversion ....................... yes
    Using system DoubleConversion ........ no
    GLib ................................... yes
    ICU .................................... no
    Using system libb2 ..................... no
    Built-in copy of the MIME database ..... yes
    cpp/winrt base ......................... no
    Tracing backend ........................ <none>
    Logging backends:
    journald ............................. no
    syslog ............................... no
    slog2 ................................ no
    PCRE2 .................................. yes
    Using system PCRE2 ................... yes
    CLONE_PIDFD support in forkfd .......... yes
    Application permissions ................ no
    Qt Sql:
    SQL item models ........................ yes
    Qt Network:
    getifaddrs() ........................... yes
    IPv6 ifname ............................ yes
    libproxy ............................... no
    Linux AF_NETLINK ....................... yes
    DTLS ................................... no
    OCSP-stapling .......................... no
    SCTP ................................... no
    Use system proxies ..................... yes
    GSSAPI ................................. no
    Brotli Decompression Support ........... yes
    qIsEffectiveTLD() ...................... yes
    Built-in publicsuffix database ....... yes
    System publicsuffix database ......... yes
    Core tools:
    Android deployment tool ................ yes
    macOS deployment tool .................. no
    Windows deployment tool ................ no
    qmake .................................. yes
    Qt Gui:
    Accessibility .......................... yes
    FreeType ............................... yes
    Using system FreeType ................ yes
    HarfBuzz ............................... yes
    Using system HarfBuzz ................ no
    Fontconfig ............................. yes
    Image formats:
    GIF .................................. yes
    ICO .................................. yes
    JPEG ................................. yes
    Using system libjpeg ............... no
    PNG .................................. yes
    Using system libpng ................ yes
    Text formats:
    HtmlParser ........................... yes
    CssParser ............................ yes
    OdfWriter ............................ yes
    MarkdownReader ....................... yes
    Using system libmd4c ............... no
    MarkdownWriter ....................... yes
    EGL .................................... yes
    OpenVG ................................. no
    OpenGL:
    Desktop OpenGL ....................... yes
    OpenGL ES 2.0 ........................ no
    OpenGL ES 3.0 ........................ no
    OpenGL ES 3.1 ........................ no
    OpenGL ES 3.2 ........................ no
    Vulkan ................................. no
    Session Management ..................... yes
    Features used by QPA backends:
    evdev .................................. yes
    libinput ............................... no
    HiRes wheel support in libinput ........ no
    INTEGRITY HID .......................... no
    mtdev .................................. no
    tslib .................................. no
    xkbcommon .............................. yes
    X11 specific:
    XLib ................................. yes
    XCB Xlib ............................. yes
    EGL on X11 ........................... yes
    xkbcommon-x11 ........................ yes
    xcb-sm ............................... no
    QPA backends:
    DirectFB ............................... no
    EGLFS .................................. yes
    EGLFS details:
    EGLFS OpenWFD ........................ no
    EGLFS i.Mx6 .......................... no
    EGLFS i.Mx6 Wayland .................. no
    EGLFS RCAR ........................... no
    EGLFS EGLDevice ...................... yes
    EGLFS GBM ............................ no
    EGLFS VSP2 ........................... no
    EGLFS Mali ........................... no
    EGLFS Raspberry Pi ................... no
    EGLFS X11 ............................ yes
    LinuxFB ................................ yes
    VNC .................................... yes
    VK_KHR_display ......................... no
    QNX:
    lgmon ................................ no
    IMF .................................. no
    XCB:
    Using system-provided xcb-xinput ..... no
    GL integrations:
    GLX Plugin ......................... no
    XCB GLX .......................... no
    EGL-X11 Plugin ..................... no
    Windows:
    Direct 2D ............................ no
    Direct 2D 1.1 ........................ no
    DirectWrite .......................... no
    DirectWrite 3 ........................ no
    Qt Widgets:
    GTK+ ................................... no
    Styles ................................. Fusion Windows
    Qt Testlib:
    Tester for item models ................. yes
    Batch tests ............................ no
    Qt PrintSupport:
    CUPS ................................... no
    Qt Sql Drivers:
    DB2 (IBM) .............................. no
    InterBase .............................. no
    MySql .................................. no
    OCI (Oracle) ........................... no
    ODBC ................................... no
    PostgreSQL ............................. no
    SQLite ................................. yes
    Using system provided SQLite ......... no
    Further Image Formats:
    JasPer ................................. no
    MNG .................................... no
    TIFF ................................... yes
    Using system libtiff ................. no
    WEBP ................................... yes
    Using system libwebp ................. no
    Qt QML:
    QML network support .................... yes
    QML debugging and profiling support .... yes
    QML just-in-time compiler .............. yes
    QML XML http request ................... yes
    QML Locale ............................. yes
    Qt QML Models:
    QML list model ......................... yes
    QML delegate model ..................... yes
    Qt Quick:
    AnimatedImage item ..................... yes
    Canvas item ............................ yes
    Support for Qt Quick Designer .......... yes
    Flipable item .......................... yes
    GridView item .......................... yes
    ListView item .......................... yes
    TableView item ......................... yes
    TreeView item .......................... yes
    Path support ........................... yes
    PathView item .......................... yes
    Positioner items ....................... yes
    Repeater item .......................... yes
    ShaderEffect item ...................... yes
    Sprite item ............................ yes
    Qt Quick Templates 2:
    Hover support .......................... yes
    Multi-touch support .................... yes
    Calendar support ....................... yes
    Qt Quick Controls 2:
    Styles ................................. Basic Fusion Imagine iOS Material Universal macOS Windows
    QtQuick3D:
    Assimp ................................. yes
    System Assimp .......................... no
    Qt Multimedia:
    Spatial Audio .......................... yes
    Spatial Audio (Quick3D) ................ yes
    Low level Audio Backend:
    ALSA (experimental) .................. no
    PulseAudio ........................... no
    MMRenderer ........................... no
    CoreAudio ............................ no
    Windows Media SDK .................... no
    Open SLES (Android) .................. no
    Web Assembly ......................... no
    Plugin:
    GStreamer 1.0 ........................ no
    FFmpeg ............................... no
    MMRenderer ........................... no
    AVFoundation ......................... no
    Windows Media Foundation ............. no
    Hardware acceleration and features:
    Video for Linux ...................... yes
    VAAPI support ........................ no
    Linux DMA buffer support ............. yes
    VideoToolbox ......................... no
    Qt 3D:
    Assimp ................................. yes
    System Assimp .......................... no
    Use SSE2 instructions .................. yes
    Use AVX2 instructions .................. no
    Aspects:
    Render aspect ........................ yes
    Input aspect ......................... yes
    Logic aspect ......................... yes
    Animation aspect ..................... yes
    Extras aspect ........................ yes
    Qt 3D APIs:
    Vulkan ................................. no
    Qt 3D Renderers:
    OpenGL Renderer ........................ yes
    RHI Renderer ........................... yes
    Qt3D Geometry Loaders:
    Autodesk FBX ........................... no
    Qt 5 Compatibility Libraries:
    iconv .................................. yes
    Qt Charts Types:
    Area Chart ............................. yes
    Line Chart ............................. yes
    Spline Chart ........................... yes
    Scatter Chart .......................... yes
    Bar Chart .............................. yes
    Pie Chart .............................. yes
    Boxplot Chart .......................... yes
    Candlestick Chart ...................... yes
    Qt Axis Types:
    DateTime Axis .......................... yes
    Qt Bluetooth:
    BlueZ .................................. no
    BlueZ Low Energy ....................... no
    Linux Crypto API ....................... no
    WinRT Bluetooth API .................... no
    Qt Tools:
    Qt Assistant ........................... yes
    QDoc ................................... no
    Clang-based lupdate parser ............. no
    Qt Designer ............................ yes
    Qt Distance Field Generator ............ yes
    Qt Linguist ............................ yes
    pixeltool .............................. yes
    qdbus .................................. yes
    Qt Attributions Scanner ................ yes
    qtdiag ................................. yes
    qtplugininfo ........................... yes
    Serial Port:
    ntddmodm ............................... no
    WebEngine Repository Build Options:
    Build Ninja ............................ no
    Build Gn ............................... yes
    Jumbo Build ............................ yes
    Developer build ........................ no
    Build QtWebEngine Modules:
    Build QtWebEngineCore ................ no
    Build QtWebEngineWidgets ............. no
    Build QtWebEngineQuick ............... no
    Build QtPdf Modules:
    Build QtPdfWidgets ................... no
    Build QtPdfQuick ..................... no
    Optional system libraries:
    re2 .................................. no
    icu .................................. no
    libwebp, libwebpmux and libwebpdemux . no
    opus ................................. no
    ffmpeg ............................... no
    libvpx ............................... no
    snappy ............................... no
    glib ................................. yes
    zlib ................................. yes
    minizip .............................. no
    libevent ............................. no
    libxml2 and libxslt .................. no
    lcms2 ................................ no
    png .................................. yes
    jpeg ................................. no
    libopenjpeg2 ......................... no
    harfbuzz ............................. no
    freetype ............................. yes
    libpci ............................... no
    Qt 3rdparty libs:
    qtfreetype ........................... no
    qtharfbuzz ........................... yes
    qtpng ................................ no
    qtjpeg ............................... yes
    qtzlib ............................... no
    Qt Protobuf tools:
    Qt Protobuf generator ................ no
    Qt GRPC:
    gRPC support ......................... yes
    Native gRPC support .................. no
    Qt GRPC tools:
    Qt GRPC generator .................... no
    Qt Opcua:
    Open62541 ............................ yes
    Unified Automation C++ SDK ........... no
    Support for namespace 0 NodeId names . yes
    Namespace 0 NodeIds generator ........ no
    Open62541 security support ........... no
    Support for global discovery server .. no
    Qt Remote Objects:
    High Availability Manager (ham) ...... no
    Qt Scxml:
    ECMAScript data model for QtScxml .... yes
    Qt Sensors:
    sensorfw ............................. no
    sensorfw_enabled_with_cmake .......... no
    Qt SerialBus:
    Socket CAN ........................... yes
    Socket CAN FD ........................ yes
    SerialPort Support ................... yes
    Qt TextToSpeech:
    Flite ................................ no
    Flite with ALSA ...................... no
    Speech Dispatcher .................... no
    Qt Virtualkeyboard:
    Desktop integration .................. yes
    Built-in layouts ..................... yes
    Key navigation ....................... no
    Retro style as default ............... no
    Sensitive Debug ...................... no
    Cerence .............................. no
    Static Linking ..................... no
    Handwriting ........................ no
    Alphabetic ....................... no
    CJK .............................. no
    XT9 ................................ no
    XT9 Debug ........................ no
    XT9 9-key layouts ................ no
    Bundle resources ................... no
    Handwriting ...................... no
    XT9 .............................. no
    Hunspell ............................. no
    Using Hunspell copy from 3rdparty/ . no
    OpenWnn .............................. yes
    MyScript ............................. no
    Language support enabled for:
    Arabic ............................. yes
    Bulgarian .......................... yes
    Czech .............................. yes
    Danish ............................. yes
    German ............................. yes
    Greek .............................. yes
    English GB ......................... yes
    English US ......................... yes
    Spanish ............................ yes
    Spanish Mexico ..................... yes
    Estonian ........................... yes
    Farsi .............................. yes
    Finnish ............................ yes
    French Canada ...................... yes
    French France ...................... yes
    Hebrew ............................. yes
    Hindi .............................. yes
    Croatian ........................... yes
    Hungarian .......................... yes
    Indonesian ......................... yes
    Italian ............................ yes
    Japanese ........................... yes
    Korean ............................. yes
    Malay .............................. yes
    Norwegian .......................... yes
    Dutch .............................. yes
    Polish ............................. yes
    Portuguese Brazil .................. yes
    Portuguese Portugal ................ yes
    Romanian ........................... yes
    Russian ............................ yes
    Slovak ............................. yes
    Slovenian .......................... yes
    Albanian ........................... yes
    Serbian ............................ yes
    Swedish ............................ yes
    Thai ............................... yes
    Turkish ............................ yes
    Ukrainian .......................... yes
    Vietnamese ......................... yes
    Simplified Chinese ................. yes
    Traditional Chinese ................ yes
    HongKong Chinese ................... no
    Traditional chinese input methods:
    Zhuyin ............................. yes
    Cangjie ............................ yes

    Note: Using static linking will disable the use of dynamically loaded plugins. Make sure to import all needed static plugins, or compile needed modules into the library.
    Note: Hunspell in Qt Virtual Keyboard is not enabled. Spelling correction will not be available.

    WARNING: No backend for low level audio found.
    WARNING: QDoc will not be compiled, probably because libclang could not be located. This means that you cannot build the Qt documentation.
    Either set CMAKE_PREFIX_PATH or LLVM_INSTALL_DIR to the location of your llvm installation.
    On Linux systems, you may be able to install libclang by installing the libclang-dev or libclang-devel package, depending on your distribution.
    On macOS, you can use Homebrew's llvm package.
    You will also need to set the FEATURE_clang CMake variable to ON to re-evaluate this check.
    WARNING: Clang-based lupdate parser will not be available. LLVM and Clang C++ libraries have not been found.
    You will need to set the FEATURE_clangcpp CMake variable to ON to re-evaluate this check.
    WARNING: QtWebEngine won't be built. Static build is not supported.
    WARNING: QtPdf won't be built. node.js version 12 or later is required.
    WARNING: SensorFW support currently not enabled with cmake

    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/autobase/Qt/6.5.3/Src
    autobase@ubuntu22044:~/Qt/6.5.3/Src$ make -j8
    make: *** No targets specified and no makefile found. Stop.

    TomZT Offline
    TomZT Offline
    TomZ
    wrote on 5 Feb 2024, 11:27 last edited by
    #3

    @hsjeong a couple of things;

    1. there is no need to compile statically as long as you simply deploy the generated dynamic libraries to your device.
    2. you most likely need to cross-compile to the architecture of your embedded device. Are you sure it is running the same CPU as the one you compile with?
      Building for: linux-g++ (x86_64, CPU features: mmx sse sse2)
    3. compiling as static means things like image plugins (jpeg/png etc) support is going to be missing. Are you sure you want to compile statically?
    1 Reply Last reply
    1
    • P Offline
      P Offline
      Peal Wang
      wrote on 7 Feb 2025, 05:41 last edited by
      #4

      This is my configure:

      md build\static-debug
      ..\..\configure.bat ^
         -platform win32-msvc ^
          -nomake tests ^
          -nomake examples ^
          -opensource -confirm-license ^
          -prefix ..\..\output\static-debug ^
          -no-pch ^
          -debug ^
          -static ^
          -static-runtime ^
          -ssl ^
          -openssl ^
          -openssl-linked ^
          -icu ^
          -gif ^
          -ico ^
          -opengl ^
          -no-egl ^
          -no-vulkan ^
          -no-xcb ^
          -no-libudev ^
          -no-slog2 ^
          -no-dbus ^
          -skip qtdoc ^
          -skip qtwayland ^
          -skip qtwebengine ^
          -skip qtwebview ^
          -system-zlib ^
          -system-libpng ^
          -system-libjpeg ^
          -system-freetype ^
          -system-harfbuzz ^
          -system-sqlite ^
          -system-pcre ^
          -system-doubleconversion ^
          -system-webp ^
          -system-tiff
      

      however, build failed with:

        正在创建库 qtshadertools\tools\qsb\qsb.lib 和对象 qtshadertools\tools\qsb\qsb.exp
      tiffd.lib(tif_lzma.c.obj) : error LNK2019: 无法解析的外部符号 lzma_code,函数 LZMAEncode 中引用了该符号
      tiffd.lib(tif_lzma.c.obj) : error LNK2019: 无法解析的外部符号 lzma_end,函数 LZMASetupDecode 中引用了该符号
      tiffd.lib(tif_lzma.c.obj) : error LNK2019: 无法解析的外部符号 lzma_memusage,函数 LZMADecode 中引用了该符号
      tiffd.lib(tif_lzma.c.obj) : error LNK2019: 无法解析的外部符号 lzma_lzma_preset,函数 TIFFInitLZMA 中引用了该符号
      tiffd.lib(tif_lzma.c.obj) : error LNK2019: 无法解析的外部符号 lzma_stream_encoder,函数 LZMAPreEncode 中引用了该符号
      tiffd.lib(tif_lzma.c.obj) : error LNK2019: 无法解析的外部符号 lzma_stream_decoder,函数 LZMADecode 中引用了该符号
      libwebp.lib(picture_csp_enc.c.obj) : error LNK2019: 无法解析的外部符号 SharpYuvConvert,函数 PreprocessARGB 中引用了该符号
      libwebp.lib(picture_csp_enc.c.obj) : error LNK2019: 无法解析的外部符号 SharpYuvGetConversionMatrix,函数 PreprocessARGB 中引用了该符号
      libwebp.lib(picture_csp_enc.c.obj) : error LNK2019: 无法解析的外部符号 SharpYuvInit,函数 ImportYUVAFromRGBA 中引用了该符号
      harfbuzz.lib(hb-uniscribe.cc.obj) : error LNK2019: 无法解析的外部符号 __imp_UuidCreate,函数 "void __cdecl _hb_generate_unique_face_name(wchar_t *,unsigned int *)" (?_hb_generate_unique_face_name@@YAXPEA_WPEAI@Z) 中引用了该符号
      harfbuzz.lib(hb-uniscribe.cc.obj) : error LNK2019: 无法解析的外部符号 ScriptFreeCache,函数 _hb_uniscribe_shaper_font_data_destroy 中引用了该符号
      harfbuzz.lib(hb-uniscribe.cc.obj) : error LNK2019: 无法解析的外部符号 ScriptItemize,函数 "long __cdecl hb_ScriptItemizeOpenType(wchar_t const *,int,int,struct tag_SCRIPT_CONTROL const *,struct tag_SCRIPT_STATE const *,struct tag_SCRIPT_ITEM *,unsigned long *,int *)" (?hb_ScriptItemizeOpenType@@YAJPEB_WHHPEBUtag_SCRIPT_CONTROL@@PEBUtag_SCRIPT_STATE@@PEAUtag_SCRIPT_ITEM@@PEAKPEAH@Z) 中引用了该符号
      harfbuzz.lib(hb-uniscribe.cc.obj) : error LNK2019: 无法解析的外部符号 ScriptShape,函数 "long __cdecl hb_ScriptShapeOpenType(struct HDC__ *,void * *,struct tag_SCRIPT_ANALYSIS *,unsigned long,unsigned long,int *,struct textrange_properties * *,int,wchar_t const *,int,int,unsigned short *,struct script_charprop *,unsigned short *,struct script_glyphprop *,int *)" (?hb_ScriptShapeOpenType@@YAJPEAUHDC__@@PEAPEAXPEAUtag_SCRIPT_ANALYSIS@@KKPEAHPEAPEAUtextrange_properties@@HPEB_WHHPEAGPEAUscript_charprop@@6PEAUscript_glyphprop@@3@Z) 中引用了该符号
      harfbuzz.lib(hb-uniscribe.cc.obj) : error LNK2019: 无法解析的外部符号 ScriptPlace,函数 "long __cdecl hb_ScriptPlaceOpenType(struct HDC__ *,void * *,struct tag_SCRIPT_ANALYSIS *,unsigned long,unsigned long,int *,struct textrange_properties * *,int,wchar_t const *,unsigned short *,struct script_charprop *,int,unsigned short const *,struct script_glyphprop const *,int,int *,struct tagGOFFSET *,struct _ABC *)" (?hb_ScriptPlaceOpenType@@YAJPEAUHDC__@@PEAPEAXPEAUtag_SCRIPT_ANALYSIS@@KKPEAHPEAPEAUtextrange_properties@@HPEB_WPEAGPEAUscript_charprop@@HPEBGPEBUscript_glyphprop@@H3PEAUtagGOFFSET@@PEAU_ABC@@@Z) 中引用了该符号
      freetyped.lib(sfnt.c.obj) : error LNK2019: 无法解析的外部符号 BrotliDecoderDecompress,函数 woff2_decompress 中引用了该符号
      freetyped.lib(ftbzip2.c.obj) : error LNK2019: 无法解析的外部符号 BZ2_bzDecompressInit,函数 ft_bzip2_file_init 中引用了该符号
      freetyped.lib(ftbzip2.c.obj) : error LNK2019: 无法解析的外部符号 BZ2_bzDecompress,函数 ft_bzip2_file_fill_output 中引用了该符号
      freetyped.lib(ftbzip2.c.obj) : error LNK2019: 无法解析的外部符号 BZ2_bzDecompressEnd,函数 ft_bzip2_file_done 中引用了该符号
      qtbase\bin\qsb.exe : fatal error LNK1120: 18 个无法解析的外部命令
      

      how to add liblzma.lib and other libraries to cmake?

      1 Reply Last reply
      0
      • P Offline
        P Offline
        Peal Wang
        wrote on 14 Feb 2025, 06:22 last edited by
        #5

        I use cmake directly and successful. This is my configure:

        cmake -S ../.. ^
          -G Ninja ^
          -DCMAKE_BUILD_TYPE=Debug ^
          -DBUILD_SHARED_LIBS=OFF ^
          -DFEATURE_static_runtime=ON ^
          -DCMAKE_INSTALL_PREFIX="C:/Library/QT/6.8.1/VS2019/x64-debug-static" ^
          -DBUILD_qtdoc=OFF ^
          -DBUILD_qtwebengine=OFF ^
          -DBUILD_qtwebview=OFF ^
          -DBUILD_qtwayland=OFF ^
          -DBUILD_WITH_PCH=OFF ^
          -DQT_INTERNAL_CALLED_FROM_CONFIGURE:BOOL=TRUE ^
          -DQT_QMAKE_TARGET_MKSPEC=win32-msvc ^
          -DCMAKE_C_COMPILER=cl ^
          -DCMAKE_CXX_COMPILER=cl ^
          -DQT_BUILD_TESTS=FALSE ^
          -DQT_BUILD_EXAMPLES=FALSE ^
          -DFEATURE_cxx20=OFF ^
          -DFEATURE_cxx2b=OFF ^
          -DFEATURE_ssl=ON ^
          -DINPUT_openssl=linked ^
          -DFEATURE_system_zlib=ON ^
          -DFEATURE_system_sqlite=ON ^
          -DINPUT_libpng=system ^
          -DINPUT_libjpeg=system ^
          -DINPUT_freetype=system ^
          -DINPUT_harfbuzz=system ^
          -DINPUT_pcre=system ^
          -DINPUT_doubleconversion=system ^
          -DINPUT_webp=system ^
          -DINPUT_tiff=system ^
          -DFEATURE_icu=ON ^
          -DFEATURE_gif=ON ^
          -DFEATURE_ico=ON ^
          -DFEATURE_vulkan=OFF ^
          -DFEATURE_xcb=OFF ^
          -DFEATURE_egl=OFF ^
          -DFEATURE_libudev=OFF ^
          -DFEATURE_slog2=OFF ^
          -DFEATURE_dbus=OFF ^
          -DCMAKE_CXX_STANDARD=17 ^
          -DCMAKE_C_STANDARD=11 ^
          -DCMAKE_EXE_LINKER_FLAGS="brotlicommon.lib brotlidec.lib brotlienc.lib bz2d.lib deflatestatic.lib libsharpyuv.lib lzma.lib rpcrt4.lib usp10.lib"
        

        The key should be to specify libs using CMAKE_EXE_LINKER_FLAGS

        1 Reply Last reply
        0
        • R Offline
          R Offline
          rparon
          wrote on 26 Feb 2025, 08:10 last edited by
          #6

          is someone static compiling 6.8.2 in Windows 11 with VS2022 ?
          I run the command

          configure.bat -platform win32-msvc -release -static -static-runtime -prefix C:\Qt/Qt6.8.2/64 -commercial -confirm-license -plugin-manifests -nomake examples -nomake tests

          I am able to compile version 6.8.1 but with version 6.8.2 I get many warnings and finally it compiles about 12000 lines (6.8.2) or source instead of about 18000 (6.8.1)

          jsulmJ 1 Reply Last reply 26 Feb 2025, 08:46
          0
          • R rparon
            26 Feb 2025, 08:10

            is someone static compiling 6.8.2 in Windows 11 with VS2022 ?
            I run the command

            configure.bat -platform win32-msvc -release -static -static-runtime -prefix C:\Qt/Qt6.8.2/64 -commercial -confirm-license -plugin-manifests -nomake examples -nomake tests

            I am able to compile version 6.8.1 but with version 6.8.2 I get many warnings and finally it compiles about 12000 lines (6.8.2) or source instead of about 18000 (6.8.1)

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on 26 Feb 2025, 08:46 last edited by
            #7

            @rparon said in How to configure QT6 static?:

            I am able to compile version 6.8.1 but with version 6.8.2 I get many warnings and finally it compiles about 12000 lines (6.8.2) or source instead of about 18000 (6.8.1)

            So, does the build succeed or not? The fact that it compiles less files can be related to what modules where activated when running configure script.

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • R Offline
              R Offline
              rparon
              wrote on 26 Feb 2025, 10:02 last edited by
              #8

              thank you for the comment,
              yes, despite the many warnings (also requesting the folder of CLang) the compling process terminates and I able to run
              ninja install
              however whenI try to compile my project (QML + C++) the linking process terminates showing a strange error, see below ,cannot open input file '(.obj'

              [ 91%] Linking CXX static library myproject.lib
              [ 92%] Built target myproject
              [ 92%] Built target myprojectx_autogen_timestamp_deps
              [ 93%] Automatic MOC for target myprojectx
              [ 93%] Built target myprojectx_autogen
              [ 94%] Running AUTOMOC file extraction for target myprojectx
              [ 94%] Running moc --collect-json for target myprojectx
              [ 97%] Building CXX object CMakeFiles/myprojectx.dir/myprojectx_autogen/mocs_compilation.cpp.obj
              [ 97%] Building CXX object CMakeFiles/myprojectx.dir/myprojectx/myprojectxx.cpp.obj
              mocs_compilation.cpp
              myprojectxx.cpp
              [ 98%] Linking CXX shared library myprojectx.dll

              ....

              failed (exit code 1181) with the following output:
              LINK : fatal error LNK1181: cannot open input file '(.obj'
              jom: E:\bin\ppp\windows\64\CMakeFiles\myprojectx.dir\build.make [myprojectx.dll] Error 2
              jom: E:\bin\ppp\windows\64\CMakeFiles\Makefile2 [CMakeFiles\myprojectx.dir\all] Error 2
              jom: E:\bin\ppp\windows\64\Makefile [all] Error 2
              01:47:28: The process "C:\CMake\bin\cmake.exe" exited with code 2.
              01:47:28: Error while building/deploying project myprojectx (kit: Qt 6.8.1(64))
              01:47:28: When executing step "Build"
              01:47:28: Elapsed time: 00:29.

              which seems strange as I am unable to locate a file name with this string / substring '(.obj' inside....

              do you have any clue to solve this problem ?

              jsulmJ 1 Reply Last reply 26 Feb 2025, 10:04
              0
              • R rparon
                26 Feb 2025, 10:02

                thank you for the comment,
                yes, despite the many warnings (also requesting the folder of CLang) the compling process terminates and I able to run
                ninja install
                however whenI try to compile my project (QML + C++) the linking process terminates showing a strange error, see below ,cannot open input file '(.obj'

                [ 91%] Linking CXX static library myproject.lib
                [ 92%] Built target myproject
                [ 92%] Built target myprojectx_autogen_timestamp_deps
                [ 93%] Automatic MOC for target myprojectx
                [ 93%] Built target myprojectx_autogen
                [ 94%] Running AUTOMOC file extraction for target myprojectx
                [ 94%] Running moc --collect-json for target myprojectx
                [ 97%] Building CXX object CMakeFiles/myprojectx.dir/myprojectx_autogen/mocs_compilation.cpp.obj
                [ 97%] Building CXX object CMakeFiles/myprojectx.dir/myprojectx/myprojectxx.cpp.obj
                mocs_compilation.cpp
                myprojectxx.cpp
                [ 98%] Linking CXX shared library myprojectx.dll

                ....

                failed (exit code 1181) with the following output:
                LINK : fatal error LNK1181: cannot open input file '(.obj'
                jom: E:\bin\ppp\windows\64\CMakeFiles\myprojectx.dir\build.make [myprojectx.dll] Error 2
                jom: E:\bin\ppp\windows\64\CMakeFiles\Makefile2 [CMakeFiles\myprojectx.dir\all] Error 2
                jom: E:\bin\ppp\windows\64\Makefile [all] Error 2
                01:47:28: The process "C:\CMake\bin\cmake.exe" exited with code 2.
                01:47:28: Error while building/deploying project myprojectx (kit: Qt 6.8.1(64))
                01:47:28: When executing step "Build"
                01:47:28: Elapsed time: 00:29.

                which seems strange as I am unable to locate a file name with this string / substring '(.obj' inside....

                do you have any clue to solve this problem ?

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on 26 Feb 2025, 10:04 last edited by
                #9

                @rparon Did you do a complete rebuild after switching to that Qt version?

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • R Offline
                  R Offline
                  rparon
                  wrote on 26 Feb 2025, 10:13 last edited by
                  #10

                  yes, I put the sources of Qt 6.8.2 in C:/Qt/6.8.2/64 and the library was compiled with VS2022 after executing

                  configure.bat -platform win32-msvc -release -static -static-runtime -prefix C:\Qt/Qt6.8.2/64 -commercial -confirm-license -plugin-manifests -nomake examples -nomake tests

                  then

                  cmake --build --parallel

                  ninja install

                  still I have previous version in C:/Qt/6.8.1/64 and C:/Qt/6.8.1/32 but I suppose there are no global vars which may cause conflicts...

                  jsulmJ 1 Reply Last reply 26 Feb 2025, 10:18
                  0
                  • R rparon
                    26 Feb 2025, 10:13

                    yes, I put the sources of Qt 6.8.2 in C:/Qt/6.8.2/64 and the library was compiled with VS2022 after executing

                    configure.bat -platform win32-msvc -release -static -static-runtime -prefix C:\Qt/Qt6.8.2/64 -commercial -confirm-license -plugin-manifests -nomake examples -nomake tests

                    then

                    cmake --build --parallel

                    ninja install

                    still I have previous version in C:/Qt/6.8.1/64 and C:/Qt/6.8.1/32 but I suppose there are no global vars which may cause conflicts...

                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on 26 Feb 2025, 10:18 last edited by
                    #11

                    @rparon I'm not talking about building Qt, I'm talking about building your project

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • R Offline
                      R Offline
                      rparon
                      wrote on 26 Feb 2025, 10:27 last edited by
                      #12

                      sure, it was the first think to do...

                      1. in build directory manually delete all files and folders (CMake cache,MOC files etc.etc.)
                      2. manually delete CMakeList.txt.user to force Qt Creator to redefine all the makefiles

                      you may imagine I was quite surprised to see exactly the same error reported -> LINK : fatal error LNK1181: cannot open input file '(.obj'

                      1 Reply Last reply
                      0
                      • R Offline
                        R Offline
                        rparon
                        wrote on 26 Feb 2025, 10:38 last edited by
                        #13

                        a possibility, which I have not investigated, is that Qt Creator or CMake may store something outside the build directory, but I am not aware of that...

                        jsulmJ 1 Reply Last reply 26 Feb 2025, 12:32
                        0
                        • R rparon
                          26 Feb 2025, 10:38

                          a possibility, which I have not investigated, is that Qt Creator or CMake may store something outside the build directory, but I am not aware of that...

                          jsulmJ Offline
                          jsulmJ Offline
                          jsulm
                          Lifetime Qt Champion
                          wrote on 26 Feb 2025, 12:32 last edited by
                          #14

                          @rparon Then you should check your CMakeLists.txt file or post it here, so others can take a look. Something must be wrong there.

                          https://forum.qt.io/topic/113070/qt-code-of-conduct

                          1 Reply Last reply
                          0
                          • R Offline
                            R Offline
                            rparon
                            wrote on 27 Feb 2025, 07:57 last edited by
                            #15

                            the cause was a bad format in module-definition (.def file) which, for unknown reasons, generated that error when linking ...
                            Now Qt 6.8.2 works fine, thank you for help.

                            1 Reply Last reply
                            0

                            • Login

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • Users
                            • Groups
                            • Search
                            • Get Qt Extensions
                            • Unsolved