Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. I cannot enable ICU library support with Qt-5.0.2
Forum Update on Monday, May 27th 2025

I cannot enable ICU library support with Qt-5.0.2

Scheduled Pinned Locked Moved Installation and Deployment
12 Posts 3 Posters 13.1k Views
  • 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.
  • I Offline
    I Offline
    ihsorihakanekat
    wrote on last edited by
    #2

    Sorry, I forgot to mention my environment.

    I'm using Vine Linux 6.1 (a RedHat Linux based Japanese distribution).
    The kernel is 3.0.71.
    I've installed glib-2.34.2, gtk+-3.6.4 and other required package in /usr/local.

    In addition to that, I've succeed to build Qt-5.1.0 from the git repository with qtwebkit. However, the WebKit doesn't seem to work correctly because Sigil-0.7.2 built with the Qt-5 won't boot.

    1 Reply Last reply
    0
    • kkoehneK Offline
      kkoehneK Offline
      kkoehne
      Moderators
      wrote on last edited by
      #3

      The configure test for icu is in qtbase/config.tests/unix/icu , and tries to link against icuuc, icui18n. Try to compile it to see why it fails. Also, you can see the output of all configure tests by running configure with '-v'.

      Director R&D, The Qt Company

      1 Reply Last reply
      0
      • I Offline
        I Offline
        ihsorihakanekat
        wrote on last edited by
        #4

        g++ icu.cpp returns the following:
        /tmp/ccnrkiVm.o: In function main': icu.cpp:(.text+0x34): undefined reference to ucol_open_51'
        icu.cpp:(.text+0x5e): undefined reference to `ucol_close_51'
        collect2: ld returned 1 exit status

        ./configure -v also returns the similar message:
        ICU auto-detection... ()
        g++ -c -m64 -pipe -O2 -Wall -W -fPIE -I../../../mkspecs/linux-g++-64 -I. -o icu.o icu.cpp
        g++ -m64 -Wl,-O1 -o icu icu.o -licuuc -licui18n
        icu.o: In function main': icu.cpp:(.text+0x19): undefined reference to ucol_open_51'
        icu.cpp:(.text+0x34): undefined reference to `ucol_close_51'
        collect2: ld returned 1 exit status
        gmake: *** [icu] Error 1
        ICU disabled.
        The ICU library support cannot be enabled.

        1 Reply Last reply
        0
        • kkoehneK Offline
          kkoehneK Offline
          kkoehne
          Moderators
          wrote on last edited by
          #5

          so ... it looks like either your icu installation is broken, or it picks up the system ICU . Try to pass the location of the header/libraries via -L, -I, e.g.

          configure -L /usr/local/icu/lib -I /usr/local/icu/include

          Director R&D, The Qt Company

          1 Reply Last reply
          0
          • I Offline
            I Offline
            ihsorihakanekat
            wrote on last edited by
            #6

            I checke the locations of ICU library and headers then tried:

            PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib64/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib:/usr/lib64:/usr/lib ./configure -v -L /usr/local/lib64/icu -I /usr/local/include/unicode -prefix /usr/local/Qt-5.0.2 -developer-build -opensource -icu

            However, configure gave back the same message as the following:

            ICU auto-detection... ()
            g++ -c -m64 -pipe -O2 -Wall -W -fPIE -I../../../mkspecs/linux-g++-64 -I. -I/usr/local/include/unicode -o icu.o icu.cpp
            g++ -m64 -Wl,-O1 -o icu icu.o -L/usr/local/lib64/icu -licuuc -licui18n
            icu.o: In function main': icu.cpp:(.text+0x19): undefined reference to ucol_open_51'
            icu.cpp:(.text+0x34): undefined reference to `ucol_close_51'
            collect2: ld returned 1 exit status
            gmake: *** [icu] Error 1
            ICU disabled.
            The ICU library support cannot be enabled.

            Then I tried to find the header files including ucol_open_51 and ucol_close_51 by:
            grep -E "ucol_open_51|ucol_close_51" /usr/local/include/unicode/*

            No header files were found.

            On the other hand,
            grep -E "ucol_open|ucol_close" /usr/local/include/unicode/*
            found many headere files including ucol_open or ucol_close.

            I wonder if icu.cpp tries to find wrong functions, ucol_open_51 and ucol_close_51.

            Regards,

            1 Reply Last reply
            0
            • kkoehneK Offline
              kkoehneK Offline
              kkoehne
              Moderators
              wrote on last edited by
              #7

              Just have a look at config.tests/unix/icu/icu.cpp . It #include's <unicode/utypes.h> . That is, it tries to resolve ucol_open_51 is because it actually picks up the system header from /usr/unicode/utypes.h, which do a #define ucol_open ucol_open_51 . So, you're linking against the right libraries, but not compiling with the right headers.

              What you should do is adding '/usr/local/include' to the search path, instead of '/usr/local/include/unicode'.

              Director R&D, The Qt Company

              1 Reply Last reply
              0
              • I Offline
                I Offline
                ihsorihakanekat
                wrote on last edited by
                #8

                PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib64/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib:/usr/lib64:/usr/lib ./configure -v -I /usr/local/include -prefix /usr/local/Qt-5.0.2 -developer-build -opensource -icu

                gave back a same message:

                ICU auto-detection... ()
                g++ -c -m64 -pipe -O2 -Wall -W -fPIE -I../../../mkspecs/linux-g++-64 -I. -I/usr/local/include -o icu.o icu.cpp
                g++ -m64 -Wl,-O1 -o icu icu.o -licuuc -licui18n
                icu.o: In function main': icu.cpp:(.text+0x19): undefined reference to ucol_open_51'
                icu.cpp:(.text+0x34): undefined reference to `ucol_close_51'
                collect2: ld returned 1 exit status
                gmake: *** [icu] Error 1
                ICU disabled.
                The ICU library support cannot be enabled.

                1 Reply Last reply
                0
                • kkoehneK Offline
                  kkoehneK Offline
                  kkoehne
                  Moderators
                  wrote on last edited by
                  #9

                  Please specify '-L /usr/local/lib64' to configure.

                  Director R&D, The Qt Company

                  1 Reply Last reply
                  0
                  • I Offline
                    I Offline
                    ihsorihakanekat
                    wrote on last edited by
                    #10

                    Thank you.
                    The configuration has successfully ended.

                    1 Reply Last reply
                    0
                    • T Offline
                      T Offline
                      tpham3783
                      wrote on last edited by
                      #11

                      I ran into a similar problem while compiling qt-5.0.2 for linux-x86; however, reconfigure with "-L <path to icu lib>" did not help much. qt-5.0.2 was still wanting to use the icu includes from the source code folders; ie wtf/icu, javascriptcore/icu. I renamed those include folders to icu.bak and used the -L configure option and everything worked.

                      I also found some other bugs in the build system, for example if you have xlib or libxrender installed on non-standard path; the build system would have problems linking with such libraries. Below is a patch I made to fix the issue by reverting to pkg-config, instead of assuming xlib and xrender are installed in standard paths.

                      I also have about 5 more patches; not sure where/who to summit the patches to. thanks

                      @
                      --- qtbase/configure.vanilla 2013-06-14 11:01:56.000000000 -0400
                      +++ qtbase/configure 2013-06-14 14:15:18.000000000 -0400
                      -4775,14 +4775,18
                      QMakeVar add DEFINES QT_NO_EVDEV
                      fi

                      +QMAKE_LIBS_XLIB=$PKG_CONFIG --libs --cflags x11 2>/dev/null
                      +

                      Check we actually have X11 :-)

                      -if compileTest x11/xlib "XLib"; then
                      +if compileTest x11/xlib "XLib" $QMAKE_LIBS_XLIB ; then
                      QT_CONFIG="$QT_CONFIG xlib"
                      fi

                      +QMAKE_LIBS_XRENDER=$PKG_CONFIG --libs --cflags x11 2>/dev/null
                      +

                      auto-detect Xrender support

                      if [ "$CFG_XRENDER" != "no" ]; then

                      • if compileTest x11/xrender "Xrender"; then
                      • if compileTest x11/xrender "Xrender" $QMAKE_LIBS_XRENDER; then
                        CFG_XRENDER=yes
                        QT_CONFIG="$QT_CONFIG xrender"
                        else
                        -4839,7 +4843,7

                        # auto-detect XInput2 support. Needed by xcb too.
                        if [ "$CFG_XINPUT2" != "no" ]; then
                        
                      •        if compileTest x11/xinput2 "XInput2"; then
                        
                      •        if compileTest x11/xinput2 "XInput2" $QMAKE_LIBS_XLIB; then
                                   CFG_XINPUT2=yes
                                   CFG_XINPUT=no
                               else
                        

                      @

                      1 Reply Last reply
                      0
                      • kkoehneK Offline
                        kkoehneK Offline
                        kkoehne
                        Moderators
                        wrote on last edited by
                        #12

                        Hi tpham3783, great that you've created patches! However, for legal reasons they cannot be imported into 'official' Qt unless you submit them to codereview.qt-project.org, and accept the license there:

                        http://qt-project.org/wiki/Qt-Contribution-Guidelines

                        The process might look a bit intimidating, but in reality it should really be a 10 minute affair (I think someone even created a video on youtube, but I can't find it right now ...)

                        Looks like your patches should go into qtbase, stable branch.

                        Director R&D, The Qt Company

                        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