Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to compile icu statically into Qt 6?

How to compile icu statically into Qt 6?

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 4 Posters 1.1k Views 3 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.
  • A Offline
    A Offline
    Alxi11
    wrote on last edited by
    #1

    Re: Statically compiling ICU on Linux?

    I want to compile icu statically into qt so that my app won't search for icu libs.

    Should I add -static-runtime to my configure command or add cmake options?

    SGaistS S 2 Replies Last reply
    0
    • A Alxi11

      Re: Statically compiling ICU on Linux?

      I want to compile icu statically into qt so that my app won't search for icu libs.

      Should I add -static-runtime to my configure command or add cmake options?

      SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      No, you have to first get or build a static version of ICU and use that one to build Qt.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      A 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        No, you have to first get or build a static version of ICU and use that one to build Qt.

        A Offline
        A Offline
        Alxi11
        wrote on last edited by
        #3

        @SGaist Hi!
        I'm building on Debian bookworm and already have libicu-dev installed. What else should I do?

        jsulmJ 1 Reply Last reply
        0
        • A Alxi11

          @SGaist Hi!
          I'm building on Debian bookworm and already have libicu-dev installed. What else should I do?

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Alxi11 said in How to compile icu statically into Qt 6?:

          libicu-dev

          This is dev package, not the lib itself. And I'm quite sure the lib itself on Debian is a shared lib, not static. As @SGaist wrote: either you get a static build or build this lib by yourself as static.

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

          1 Reply Last reply
          1
          • A Alxi11

            Re: Statically compiling ICU on Linux?

            I want to compile icu statically into qt so that my app won't search for icu libs.

            Should I add -static-runtime to my configure command or add cmake options?

            S Offline
            S Offline
            SimonSchroeder
            wrote on last edited by
            #5

            @Alxi11 said in How to compile icu statically into Qt 6?:

            I want to compile icu statically into qt so that my app won't search for icu libs.

            ICU decides itself if it is static or dynamic. Through package managers you always get dynamic libraries. There is nothing Qt can do about this.

            Most likely, you have to compile ICU statically yourself. And then you need to teach Qt to link against the static library. This basically means that you also need to compile Qt yourself and during Qt compilation point it to your static ICU library. Once you have a Qt library compiled to link against a static ICU, you can use that Qt library just like normal inside your own applications.

            @Alxi11 said in How to compile icu statically into Qt 6?:

            Should I add -static-runtime to my configure command or add cmake options?

            -static-runtime is just about the C or C++ runtime. There is no command to link to a dynamic library as if it where static.

            Most likely the actual problem you are trying to solve is that not everybody has the right libs installed on their machine. We are using linuxdeploy and linuxdeployqt to create an AppImage which has all dynamic libraries included (there is also snap and flatpack). Only downside: these check that you are running on an older Linux distro in order to make it compatible with most supported Linux versions out there.

            1 Reply Last reply
            1

            • Login

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