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. Build Qt on Ubuntu 22: md4c::md4c-html
Qt 6.11 is out! See what's new in the release blog

Build Qt on Ubuntu 22: md4c::md4c-html

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 1.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.
  • D Offline
    D Offline
    DungeonLords
    wrote on last edited by DungeonLords
    #1

    I try build Qt from source code in Ubuntu 22, but I get error

    CMake Error at /usr/lib/x86_64-linux-gnu/cmake/md4c/md4cConfig.cmake:95 (message):
      The imported target "md4c::md4c-html" references the file
    
         "/usr/lib/x86_64-linux-gnu/libmd4c-html.so.0.4.8"
    

    This is my Qt build steps

    # host: Ubuntu 22
    # sudo apt-get build-dep qtbase5-dev cmake ninja-build
    
    # I forget this line
    # sudo apt-get install libmd4c*
    
    # This steps use Qt mirror on github because of fast downloading from github. But you can use 
    # git clone git://code.qt.io/qt/qt5.git qt5
    
    export MyQtBaseDir=$PWD
    # Prepare Qt
    cd ${MyQtBaseDir}
    # Qt's folders must be clear: remove and create its again
    rm -Rf ${MyQtBaseDir}/build_host_powerfull/ ${MyQtBaseDir}/build_artifacts_host_powerfull/ && mkdir ${MyQtBaseDir}/build_host_powerfull ${MyQtBaseDir}/build_artifacts_host_powerfull
    
    # If you want test another Qr version do: 
    #rm -Rf ${MyQtBaseDir}/qt5/
    git clone https://github.com/qt/qt5 qt5
    cd qt5
    # git switch 6.6.0
    perl init-repository --module-subset=qtbase,qtserialport,qtcharts
    
    export QT_DEBUG_PLUGINS=1
    # export QT_QPA_EGLFS_FB=/dev/fb0
    
    cd ${MyQtBaseDir}/build_host_powerfull
    ../qt5/configure -release -static -opensource -nomake examples -nomake tests -confirm-license -skip webengine -skip qtwayland -skip qtdoc -skip qtgraphicaleffects -skip qtqa -skip qttranslations -skip qtvirtualkeyboard -skip qtquicktimeline -skip qtquick3d -skip qt3d -skip qtrepotools -skip qttools -skip qtimageformats -skip qtnetworkauth -skip qtwebsockets -skip qtactiveqt -skip qtmacextras -skip winextras -skip qtmultimedia -skip qtgamepad -skip qtserialbus -skip qtspeech -skip qtsensors -skip qtlocation -no-ssl -prefix ../build_artifacts_host_powerfull -skip qtserialport -skip qtcharts -- -GNinja -DCMAKE_TOOLCHAIN_FILE=../toolchain_host_powerfull.cmake
    cmake --build . --parallel && cmake --install .
    

    This is my toolchain_host_powerfull.cmake

    cmake_minimum_required(VERSION 3.18)
    include_guard(GLOBAL)
    
    #set(CMAKE_GENERATOR "Ninja")
    #can't off this set(FEATURE_pcre2 OFF)
    #set(FEATURE_opengl OFF)
    #set(FEATURE_ico OFF)
    #set(FEATURE_xcb OFF)
    #set(FEATURE_xcb_xlib OFF)
    set(FEATURE_network ON)
    set(FEATURE_sctp OFF)
    set(FEATURE_widgets ON)
    #enable signal-slot
    #set(FEATURE_dbus OFF)
    #set(FEATURE_dbus_linked OFF)
    
    #set(FEATURE_gui ON)
    #set(FEATURE_sqlmodel OFF)
    #set(FEATURE_sql OFF)
    set(FEATURE_androiddeployqt OFF)
    #set(testlib OFF)
    #set(X11_SUPPORTED OFF) # more https://bugreports.qt.io/browse/QTBUG-109028
    set(FEATURE_c89 OFF)
    #set(FEATURE_c99 OFF)
    #set(FEATURE_c11 OFF)
    set(FEATURE_pkg_config OFF)
    #set(FEATURE_testlib OFF)
    #set(FEATURE_translation OFF)
    #set(FEATURE_xml OFF)
    #set(FEATURE_backtrace OFF)
    #set(FEATURE_animation OFF)
    #set(FEATURE_intelcet OFF)
    #set(BUILD_WITH_PCH OFF)
    #set(FEATURE_x86intrin OFF)
    #build static Qt 
    set(BUILD_SHARED_LIBS ON) #Build Qt statically (OFF) or dynamically (ON)
    #set(FEATURE_static ON)
    #no qmake
    #set(FEATURE_qmake OFF)
    
    set(CMAKE_C_FLAGS_INIT "static")
    set(CMAKE_CXX_FLAGS_INIT "static")
    set(CMAKE_BUILD_TYPE "Debug")
    
    include(CMakeInitializeConfigs)
    
    function(cmake_initialize_per_config_variable _PREFIX _DOCSTRING)
      if (_PREFIX MATCHES "CMAKE_(C|CXX|ASM)_FLAGS")
        set(CMAKE_${CMAKE_MATCH_1}_FLAGS_INIT "${QT_COMPILER_FLAGS}")
            
        foreach (config DEBUG RELEASE MINSIZEREL RELWITHDEBINFO)
          if (DEFINED QT_COMPILER_FLAGS_${config})
            set(CMAKE_${CMAKE_MATCH_1}_FLAGS_${config}_INIT "${QT_COMPILER_FLAGS_${config}}")
          endif()
        endforeach()
      endif()
    
    
      if (_PREFIX MATCHES "CMAKE_(SHARED|MODULE|EXE)_LINKER_FLAGS")
        foreach (config SHARED MODULE EXE)
          set(CMAKE_${config}_LINKER_FLAGS_INIT "${QT_LINKER_FLAGS}")
        endforeach()
      endif()
    
      _cmake_initialize_per_config_variable(${ARGV})
    endfunction()
    
    1 Reply Last reply
    0
    • D Offline
      D Offline
      DungeonLords
      wrote on last edited by DungeonLords
      #2

      To solve this problem do

      sudo apt-get install libmd4c*
      

      Full code here.

      1 Reply Last reply
      0
      • D DungeonLords has marked this topic as solved on

      • Login

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