Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. [Move] Linking to ICU library
Forum Updated to NodeBB v4.3 + New Features

[Move] Linking to ICU library

Scheduled Pinned Locked Moved Qt Creator and other tools
3 Posts 2 Posters 4.7k Views 1 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.
  • S Offline
    S Offline
    sungkhum
    wrote on last edited by
    #1

    Hello,

    I am new to Qt and new to C++

    I am desiring to create a small application that uses a part of ICU (the ICU line-break iterator - http://site.icu-project.org) in order to add a zero-width space between words in the Khmer language (Khmer doesn't have spaces between words). We already created a program that works in the console in Ubuntu 11.x but we are not sure how to proceed to create a GUI in Qt.

    Can anyone help give me the best option to add the ICU libraries to my project in Qt (I can compile static or shared ICU libraries)? Or direct me to documentation that would help?

    The current code and linux program can be downloaded here: http://www.sbbic.org/sbbicdownloads20 if anyone wants to take a look. Or you can take a look at the sample icu/source/samples/break/break.cpp and get the general idea (the code we wrote is based on that example).

    Thanks,
    Nathan

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

      You can find some explanations in the "Declaring Other Libraries":/doc/qt-4.8/qmake-project-files.html#declaring-other-libraries section of the "qmake manual":/doc/qt-4.8/qmake-manual.html

      Basically you do it the same way as with other C/C++ projects.

      The short story is

      @

      to extend the #include search path:

      INCLUDEPATH += /path/to/icu/include

      add the libs

      -L adds a search path

      only needed once for a particular path

      -l (lower case L) adds a certain lib

      needed for every lib you link against

      assuming you have a libicu.a or libicu.so in that directory

      LIBS += -L/path/to/icu/lib -licu
      @

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sungkhum
        wrote on last edited by
        #3

        Thanks Volker - that helps!

        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