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. Build sqlite driver with ICU extension

Build sqlite driver with ICU extension

Scheduled Pinned Locked Moved Solved Installation and Deployment
8 Posts 3 Posters 1.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.
  • M Offline
    M Offline
    marcv
    wrote on last edited by
    #1

    Hi.

    I need to use the ICU extension with sqlite, but I didn't succeed in compiling it with Qt.

    The loadable extension on sqlite works well (I'm on linux)

    gcc -fPIC -shared icu.c `pkg-config --libs --cflags icu-uc icu-io` -o libicu.so -I/usr/include/
    

    I try to build a Qt driver with this extension enabled.
    What I do:
    Git clone qtbase, then checkout to the version I use (v5.9.9, another guy is in charge for the update).
    I add to the file src/plugins/sqldrivers/sqlite/sqlite.pro just after the TARGET line:

    DEFINES += SQLITE_ENABLE_ICU
    QMAKE_CXXFLAGS += -licuio -licui18n -licuuc -licudata
    

    (I tried with QMAKE_LDFLAGS, same result).
    then

    ./configure -qt-sqlite
    cd src/plugins/sqldrivers/sqlite
    qmake
    make
    

    And I receive a lot of undefined reference to u_foldCase_66, undefined reference to ucol_strcoll_66, etc.
    (I don't know where the _66 come from).

    What did I do wrong (maybe I want something impossible or not in the right way to do)?

    Thank you.

    jsulmJ 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by SGaist
      #2

      Hi and welcome to devnet,

      @marcv said in Build sqlite driver with ICU extension:

      u_foldCase_66

      Any chances you have ICU 66 in your system ?

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

      M 1 Reply Last reply
      0
      • M marcv

        Hi.

        I need to use the ICU extension with sqlite, but I didn't succeed in compiling it with Qt.

        The loadable extension on sqlite works well (I'm on linux)

        gcc -fPIC -shared icu.c `pkg-config --libs --cflags icu-uc icu-io` -o libicu.so -I/usr/include/
        

        I try to build a Qt driver with this extension enabled.
        What I do:
        Git clone qtbase, then checkout to the version I use (v5.9.9, another guy is in charge for the update).
        I add to the file src/plugins/sqldrivers/sqlite/sqlite.pro just after the TARGET line:

        DEFINES += SQLITE_ENABLE_ICU
        QMAKE_CXXFLAGS += -licuio -licui18n -licuuc -licudata
        

        (I tried with QMAKE_LDFLAGS, same result).
        then

        ./configure -qt-sqlite
        cd src/plugins/sqldrivers/sqlite
        qmake
        make
        

        And I receive a lot of undefined reference to u_foldCase_66, undefined reference to ucol_strcoll_66, etc.
        (I don't know where the _66 come from).

        What did I do wrong (maybe I want something impossible or not in the right way to do)?

        Thank you.

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

        @marcv said in Build sqlite driver with ICU extension:

        QMAKE_CXXFLAGS += -licuio -licui18n -licuuc -licudata

        Two comments:

        1. You should use LIBS instead of QMAKE_CXXFLAGS (see https://doc.qt.io/qtcreator/creator-project-qmake-libraries.html
        2. You should also add -LPATH_TO_FOLDER_CONTAINING_LIB

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

        1 Reply Last reply
        1
        • SGaistS SGaist

          Hi and welcome to devnet,

          @marcv said in Build sqlite driver with ICU extension:

          u_foldCase_66

          Any chances you have ICU 66 in your system ?

          M Offline
          M Offline
          marcv
          wrote on last edited by
          #4

          @SGaist said in Build sqlite driver with ICU extension:

          Hi and welcome to devnet,

          @marcv said in Build sqlite driver with ICU extension:

          u_foldCase_66

          Any chances you have ICU 66 in your system ?

          Yes, I have libicu66 installed.
          What I don't understand is in the code where the error occurs, there is u_foldCase(), but no u_foldCase_66 (and even google does not seems to know it, only on a project "native_bridge_support" for Android).

          @jsulm said in Build sqlite driver with ICU extension:

          @marcv said in Build sqlite driver with ICU extension:

          QMAKE_CXXFLAGS += -licuio -licui18n -licuuc -licudata

          Two comments:

          1. You should use LIBS instead of QMAKE_CXXFLAGS (see https://doc.qt.io/qtcreator/creator-project-qmake-libraries.html
          2. You should also add -LPATH_TO_FOLDER_CONTAINING_LIB

          Thank you for your tips.
          Sadly I have the same errors.

          jsulmJ 1 Reply Last reply
          0
          • M marcv

            @SGaist said in Build sqlite driver with ICU extension:

            Hi and welcome to devnet,

            @marcv said in Build sqlite driver with ICU extension:

            u_foldCase_66

            Any chances you have ICU 66 in your system ?

            Yes, I have libicu66 installed.
            What I don't understand is in the code where the error occurs, there is u_foldCase(), but no u_foldCase_66 (and even google does not seems to know it, only on a project "native_bridge_support" for Android).

            @jsulm said in Build sqlite driver with ICU extension:

            @marcv said in Build sqlite driver with ICU extension:

            QMAKE_CXXFLAGS += -licuio -licui18n -licuuc -licudata

            Two comments:

            1. You should use LIBS instead of QMAKE_CXXFLAGS (see https://doc.qt.io/qtcreator/creator-project-qmake-libraries.html
            2. You should also add -LPATH_TO_FOLDER_CONTAINING_LIB

            Thank you for your tips.
            Sadly I have the same errors.

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

            @marcv Then please show your current pro file.
            Also, did you make a complete rebuild (delete build folder, run qmake and build) after changing the pro file?

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

            1 Reply Last reply
            0
            • M Offline
              M Offline
              marcv
              wrote on last edited by marcv
              #6
              TARGET = qsqlite
              
              DEFINES += SQLITE_ENABLE_ICU
              
              LIBS += -licuio -licui18n -licuuc -licudata -L/home/marc/labo/icu
              
              HEADERS += $$PWD/qsql_sqlite_p.h
              SOURCES += $$PWD/qsql_sqlite.cpp $$PWD/smain.cpp
              
              include($$OUT_PWD/../qtsqldrivers-config.pri)
              QT_FOR_CONFIG += sqldrivers-private
              
              qtConfig(system-sqlite) {
                  QMAKE_USE += sqlite
              } else {
                  include($$PWD/../../../3rdparty/sqlite.pri)
              }
              
              OTHER_FILES += sqlite.json
              
              PLUGIN_CLASS_NAME = QSQLiteDriverPlugin
              include(../qsqldriverbase.pri)
              

              /home/marc/labo/icu is where the file libicu.so is located.

              Yes I make a complete rebuild (to be sure I removed the repository and recloned it).

              The complete error file is here: https://pastebin.com/y8a9TUUi

              jsulmJ 1 Reply Last reply
              0
              • M marcv
                TARGET = qsqlite
                
                DEFINES += SQLITE_ENABLE_ICU
                
                LIBS += -licuio -licui18n -licuuc -licudata -L/home/marc/labo/icu
                
                HEADERS += $$PWD/qsql_sqlite_p.h
                SOURCES += $$PWD/qsql_sqlite.cpp $$PWD/smain.cpp
                
                include($$OUT_PWD/../qtsqldrivers-config.pri)
                QT_FOR_CONFIG += sqldrivers-private
                
                qtConfig(system-sqlite) {
                    QMAKE_USE += sqlite
                } else {
                    include($$PWD/../../../3rdparty/sqlite.pri)
                }
                
                OTHER_FILES += sqlite.json
                
                PLUGIN_CLASS_NAME = QSQLiteDriverPlugin
                include(../qsqldriverbase.pri)
                

                /home/marc/labo/icu is where the file libicu.so is located.

                Yes I make a complete rebuild (to be sure I removed the repository and recloned it).

                The complete error file is here: https://pastebin.com/y8a9TUUi

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

                @marcv said in Build sqlite driver with ICU extension:

                -L/home/marc/labo/icu

                Try to put this as first entry in LIBS.

                "/home/marc/labo/icu is where the file libicu.so is located." - what about all the other icu* libs?

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

                M 1 Reply Last reply
                2
                • jsulmJ jsulm

                  @marcv said in Build sqlite driver with ICU extension:

                  -L/home/marc/labo/icu

                  Try to put this as first entry in LIBS.

                  "/home/marc/labo/icu is where the file libicu.so is located." - what about all the other icu* libs?

                  M Offline
                  M Offline
                  marcv
                  wrote on last edited by marcv
                  #8

                  @jsulm said in Build sqlite driver with ICU extension:

                  @marcv said in Build sqlite driver with ICU extension:

                  -L/home/marc/labo/icu

                  Try to put this as first entry in LIBS.

                  "/home/marc/labo/icu is where the file libicu.so is located." - what about all the other icu* libs?

                  Same.

                  The icu headers are in "/usr/include/unicode" and the libs in "/usr/lib/x86_64-linux-gnu", but that's the purpose of -licuio -licui18n -licuuc -licudata.
                  I thought...

                  BUT IT WORKS !!!!

                  The final .pro file is:

                  TARGET = qsqlite
                  
                  DEFINES += SQLITE_ENABLE_ICU
                  
                  LIBS += -L/usr/lib/x86_64-linux-gnu -licuio -licui18n -licuuc -licudata
                  
                  HEADERS += $$PWD/qsql_sqlite_p.h
                  SOURCES += $$PWD/qsql_sqlite.cpp $$PWD/smain.cpp
                  
                  include($$OUT_PWD/../qtsqldrivers-config.pri)
                  QT_FOR_CONFIG += sqldrivers-private
                  
                  qtConfig(system-sqlite) {
                      QMAKE_USE += sqlite
                  } else {
                      include($$PWD/../../../3rdparty/sqlite.pri)
                  }
                  
                  OTHER_FILES += sqlite.json
                  
                  PLUGIN_CLASS_NAME = QSQLiteDriverPlugin
                  include(../qsqldriverbase.pri
                  

                  I have my qtbase/plugins/sqldrivers/libqsqlite.so file. Now I can pass to the coding part.

                  Thank you very much for your 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