Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Problem beim Erstellen des mysqldriver dlopen



  • Guten Tag,
    ich möchte eine QT-Anwendung schreiben, mit der ich auf eine mysql Datenbank zugreife. Im ersten Step möchte ich nur eine Verbindung herstellen. Hierfür gibt es genügend Beispiele im Netz. Ich bin jetzt dabei den mysql treiber unter Ubuntu zu erstellen im Verzeichnis:

    ~/Qt/5.14.1/Src

    mit folgendem Befehl:

    sudo ./configure -sql-mysql

    sudo ./configure -sql-mysql
    + cd qtbase
    + /home/dennis/Qt/5.14.1/Src/qtbase/configure -top-level -sql-mysql
    Creating qmake...
    .Done.
    
    Selecting Qt Edition.
    
    Type 'c' if you want to use the Commercial Edition.
    Type 'o' if you want to use the Open Source Edition.
    
    Which edition of Qt do you want to use? o
    
    This is the Qt Open Source Edition.
     
    You are licensed to use this software under the terms of
    the GNU Lesser General Public License (LGPL) version 3
    or the GNU General Public License (GPL) version 2.
     
    Type 'L' to view the GNU Lesser General Public License version 3 (LGPLv3).
    Type 'G' to view the GNU General Public License version 2 (GPLv2).
    Type 'y' to accept this license offer.
    Type 'n' to decline this license offer.
     
    Do you accept the terms of either license? y
    
    
    Running configuration tests...
    Done running configuration tests.
    
    Configure summary:
    
    Build type: linux-g++ (x86_64, CPU features: mmx sse sse2)
    Compiler: gcc 7.4.0
    Configuration: sse2 aesni sse3 ssse3 sse4_1 sse4_2 avx avx2 avx512f avx512bw avx512cd avx512dq avx512er avx512ifma avx512pf avx512vbmi avx512vl compile_examples enable_new_dtags f16c largefile precompile_header rdrnd shani x86SimdAlways shared shared rpath release c++11 c++14 c++1z concurrent dbus reduce_exports reduce_relocations stl
    Build options:
      Mode ................................... release
      Optimize release build for size ........ no
      Building shared libraries .............. yes
      Using C standard ....................... C11
      Using C++ standard ..................... C++17
      Using ccache ........................... no
      Using new DTAGS ........................ yes
      Relocatable ............................ yes
      Using precompiled headers .............. yes
      Using LTCG ............................. no
      Target compiler supports:
        SSE .................................. SSE2 SSE3 SSSE3 SSE4.1 SSE4.2
        AVX .................................. AVX AVX2
        AVX512 ............................... F ER CD PF DQ BW VL IFMA VBMI
        Other x86 ............................ AES F16C RDRAND SHA
        Intrinsics without -mXXX option ...... yes
      Build parts ............................ libs examples tools
    Qt modules and options:
      Qt Concurrent .......................... yes
      Qt D-Bus ............................... yes
      Qt D-Bus directly linked to libdbus .... no
      Qt Gui ................................. yes
      Qt Network ............................. yes
      Qt Sql ................................. yes
      Qt Testlib ............................. yes
      Qt Widgets ............................. yes
      Qt Xml ................................. yes
    Support enabled for:
      Using pkg-config ....................... yes
      udev ................................... yes
      Using system zlib ...................... yes
      Zstandard support ...................... no
    Qt Core:
      DoubleConversion ....................... yes
        Using system DoubleConversion ........ no
      GLib ................................... yes
      iconv .................................. yes
      ICU .................................... no
      Built-in copy of the MIME database ..... yes
      Tracing backend ........................ <none>
      Logging backends:
        journald ............................. no
        syslog ............................... no
        slog2 ................................ no
      PCRE2 .................................. yes
        Using system PCRE2 ................... no
    Qt Network:
      getifaddrs() ........................... yes
      IPv6 ifname ............................ yes
      libproxy ............................... no
      Linux AF_NETLINK ....................... yes
      OpenSSL ................................ yes
        Qt directly linked to OpenSSL ........ no
      OpenSSL 1.1 ............................ yes
      DTLS ................................... yes
      OCSP-stapling .......................... yes
      SCTP ................................... no
      Use system proxies ..................... yes
      GSSAPI ................................. no
    Qt Gui:
      Accessibility .......................... yes
      FreeType ............................... yes
        Using system FreeType ................ no
      HarfBuzz ............................... yes
        Using system HarfBuzz ................ no
      Fontconfig ............................. no
      Image formats:
        GIF .................................. yes
        ICO .................................. yes
        JPEG ................................. yes
          Using system libjpeg ............... no
        PNG .................................. yes
          Using system libpng ................ no
      Text formats:
        HtmlParser ........................... yes
        CssParser ............................ yes
        OdfWriter ............................ yes
        MarkdownReader ....................... yes
          Using system libmd4c ............... no
        MarkdownWriter ....................... yes
      EGL .................................... yes
      OpenVG ................................. no
      OpenGL:
        Desktop OpenGL ....................... yes
        OpenGL ES 2.0 ........................ no
        OpenGL ES 3.0 ........................ no
        OpenGL ES 3.1 ........................ no
        OpenGL ES 3.2 ........................ no
      Vulkan ................................. no
      Session Management ..................... yes
    Features used by QPA backends:
      evdev .................................. yes
      libinput ............................... yes
      INTEGRITY HID .......................... no
      mtdev .................................. yes
      tslib .................................. no
      xkbcommon .............................. yes
      X11 specific:
        XLib ................................. yes
        XCB Xlib ............................. yes
        EGL on X11 ........................... yes
    QPA backends:
      DirectFB ............................... no
      EGLFS .................................. yes
      EGLFS details:
        EGLFS OpenWFD ........................ no
        EGLFS i.Mx6 .......................... no
        EGLFS i.Mx6 Wayland .................. no
        EGLFS RCAR ........................... no
        EGLFS EGLDevice ...................... yes
        EGLFS GBM ............................ no
        EGLFS VSP2 ........................... no
        EGLFS Mali ........................... no
        EGLFS Raspberry Pi ................... no
        EGLFS X11 ............................ yes
      LinuxFB ................................ yes
      VNC .................................... yes
      XCB:
        Using system-provided XCB libraries .. no
        XCB XKB .............................. no
        XCB XInput ........................... yes
        Native painting (experimental) ....... no
        GL integrations:
          GLX Plugin ......................... yes
            XCB GLX .......................... yes
          EGL-X11 Plugin ..................... yes
    Qt Sql:
      SQL item models ........................ yes
    Qt Widgets:
      GTK+ ................................... no
      Styles ................................. Fusion Windows
    Qt PrintSupport:
      CUPS ................................... no
    Qt Sql Drivers:
      DB2 (IBM) .............................. no
      InterBase .............................. no
      MySql .................................. yes
      OCI (Oracle) ........................... no
      ODBC ................................... no
      PostgreSQL ............................. no
      SQLite2 ................................ no
      SQLite ................................. yes
        Using system provided SQLite ......... no
      TDS (Sybase) ........................... no
    Qt Testlib:
      Tester for item models ................. yes
    Serial Port:
      ntddmodm ............................... no
    Qt SerialBus:
      Socket CAN ............................. yes
      Socket CAN FD .......................... yes
      SerialPort Support ..................... yes
    Further Image Formats:
      JasPer ................................. no
      MNG .................................... no
      TIFF ................................... yes
        Using system libtiff ................. no
      WEBP ................................... yes
        Using system libwebp ................. no
    Qt QML:
      QML network support .................... yes
      QML debugging and profiling support .... yes
      QML just-in-time compiler .............. yes
      QML sequence object .................... yes
      QML XML http request ................... yes
      QML Locale ............................. yes
    Qt QML Models:
      QML list model ......................... yes
      QML delegate model ..................... yes
    Qt Quick:
      Direct3D 12 ............................ no
      AnimatedImage item ..................... yes
      Canvas item ............................ yes
      Support for Qt Quick Designer .......... yes
      Flipable item .......................... yes
      GridView item .......................... yes
      ListView item .......................... yes
      TableView item ......................... yes
      Path support ........................... yes
      PathView item .......................... yes
      Positioner items ....................... yes
      Repeater item .......................... yes
      ShaderEffect item ...................... yes
      Sprite item ............................ yes
    QtQuick3D:
      Assimp ................................. yes
      System Assimp .......................... no
    Qt Scxml:
      ECMAScript data model for QtScxml ...... yes
    Qt Gamepad:
      SDL2 ................................... no
    Qt 3D:
      Assimp ................................. yes
      System Assimp .......................... no
      Output Qt3D Job traces ................. no
      Output Qt3D GL traces .................. no
      Use SSE2 instructions .................. yes
      Use AVX2 instructions .................. no
      Aspects:
        Render aspect ........................ yes
        Input aspect ......................... yes
        Logic aspect ......................... yes
        Animation aspect ..................... yes
        Extras aspect ........................ yes
    Qt 3D Renderers:
      OpenGL Renderer ........................ yes
    Qt 3D GeometryLoaders:
      Autodesk FBX ........................... no
    Qt Wayland Drivers:
      EGL .................................... yes
      Raspberry Pi ........................... no
      XComposite EGL ......................... no
      XComposite GLX ......................... no
      DRM EGL ................................ yes
      libhybris EGL .......................... no
      Linux dma-buf server buffer integration . yes
      Vulkan-based server buffer integration . no
      Shm emulation server buffer integration . yes
    Qt Wayland Client Shell Integrations:
      xdg-shell .............................. yes
      xdg-shell unstable v5 (deprecated) ..... yes
      xdg-shell unstable v6 .................. yes
      ivi-shell .............................. yes
      wl-shell (deprecated) .................. yes
    Qt Wayland Client ........................ yes
    Qt Wayland Compositor .................... yes
    Qt Wayland Compositor Layer Plugins:
      VSP2 hardware layer integration ........ no
    Qt Bluetooth:
      BlueZ .................................. no
      BlueZ Low Energy ....................... no
      Linux Crypto API ....................... no
      Native Win32 Bluetooth ................. no
      WinRT Bluetooth API (desktop & UWP) .... no
      WinRT advanced bluetooth low energy API (desktop & UWP) . no
    Qt Sensors:
      sensorfw ............................... no
    Qt Quick Controls 2:
      Styles ................................. Default Fusion Imagine Material Universal
    Qt Quick Templates 2:
      Hover support .......................... yes
      Multi-touch support .................... yes
    Qt Positioning:
      Gypsy GPS Daemon ....................... no
      WinRT Geolocation API .................. no
    Qt Location:
      Qt.labs.location experimental QML plugin . yes
      Geoservice plugins:
        OpenStreetMap ........................ yes
        HERE ................................. yes
        Esri ................................. yes
        Mapbox ............................... yes
        MapboxGL ............................. yes
        Itemsoverlay ......................... yes
    QtXmlPatterns:
      XML schema support ..................... yes
    Qt Multimedia:
      ALSA ................................... no
      GStreamer 1.0 .......................... no
      GStreamer 0.10 ......................... no
      Video for Linux ........................ yes
      OpenAL ................................. no
      PulseAudio ............................. no
      Resource Policy (libresourceqt5) ....... no
      Windows Audio Services ................. no
      DirectShow ............................. no
      Windows Media Foundation ............... no
    Qt TextToSpeech:
      Flite .................................. no
      Flite with ALSA ........................ no
      Speech Dispatcher ...................... no
    Qt Tools:
      QDoc ................................... no
    Qt WebEngine Build Tools:
      Use System Ninja ....................... no
      Use System Gn .......................... no
      Jumbo Build Merge Limit ................ 8
      Developer build ........................ no
      QtWebEngine required system libraries:
        fontconfig ........................... no
        dbus ................................. no
        nss .................................. no
        khr .................................. yes
        glibc ................................ yes
      QtWebEngine required system libraries for qpa-xcb:
        x11 .................................. yes
        libdrm ............................... yes
        xcomposite ........................... no
        xcursor .............................. no
        xi ................................... no
        xtst ................................. no
      Optional system libraries used:
        re2 .................................. no
        icu .................................. no
        libwebp, libwebpmux and libwebpdemux . no
        opus ................................. no
        ffmpeg ............................... no
        libvpx ............................... no
        snappy ............................... no
        glib ................................. yes
        zlib ................................. yes
        minizip .............................. no
        libevent ............................. no
        jsoncpp .............................. no
        protobuf ............................. no
        libxml2 and libxslt .................. no
        lcms2 ................................ no
        png .................................. no
        JPEG ................................. no
        harfbuzz ............................. no
        freetype ............................. no
    
    Note: Also available for Linux: linux-clang linux-icc
    
    Note: Disabling X11 Accessibility Bridge: D-Bus or AT-SPI is missing.
    
    Note: The following modules are not being compiled in this configuration:
        webenginecore
        webengine
        webenginewidgets
    
    WARNING: QDoc will not be compiled, probably because libclang could not be located. This means that you cannot build the Qt documentation.
    
    Either ensure that llvm-config is in your PATH environment variable, or set LLVM_INSTALL_DIR to the location of your llvm installation.
    On Linux systems, you may be able to install libclang by installing the libclang-dev or libclang-devel package, depending on your distribution.
    On macOS, you can use Homebrew's llvm package.
    On Windows, you must set LLVM_INSTALL_DIR to the installation path.
    
    WARNING: Tool gperf is required to build QtWebEngine.
    
    WARNING: QtWebEngine will not be built.
    
    WARNING: QtPdf will not be built.
    
    Qt is now configured for building. Just run 'make'.
    Once everything is built, you must run 'make install'.
    Qt will be installed into '/usr/local/Qt-5.14.1'.
    
    Prior to reconfiguration, make sure you remove any leftovers from
    the previous build.
    

    Das läuft soweit auch durch.
    Im Anschluss führe ich das sudo make aus und es erscheint folgende Fehlermeldung:

    cd sqldrivers/ && ( test -e Makefile || /home/dennis/Qt/5.14.1/Src/qtbase/bin/qmake -o Makefile /home/dennis/Qt/5.14.1/Src/qtbase/src/plugins/sqldrivers/sqldrivers.pro ) && make -f Makefile 
    make[4]: Verzeichnis „/home/dennis/Qt/5.14.1/Src/qtbase/src/plugins/sqldrivers“ wird betreten
    cd mysql/ && ( test -e Makefile || /usr/lib/qt5/bin/qmake -o Makefile /home/dennis/Qt/5.14.1/Src/qtbase/src/plugins/sqldrivers/mysql/mysql.pro ) && make -f Makefile 
    make[5]: Verzeichnis „/home/dennis/Qt/5.14.1/Src/qtbase/src/plugins/sqldrivers/mysql“ wird betreten
    make[5]: Für das Ziel „first“ ist nichts zu tun.
    make[5]: Verzeichnis „/home/dennis/Qt/5.14.1/Src/qtbase/src/plugins/sqldrivers/mysql“ wird verlassen
    cd sqlite/ && ( test -e Makefile || /usr/lib/qt5/bin/qmake -o Makefile /home/dennis/Qt/5.14.1/Src/qtbase/src/plugins/sqldrivers/sqlite/sqlite.pro ) && make -f Makefile 
    Project ERROR: Could not find feature dlopen.
    Makefile:70: recipe for target 'sub-sqlite-make_first' failed
    make[4]: *** [sub-sqlite-make_first] Error 3
    make[4]: Verzeichnis „/home/dennis/Qt/5.14.1/Src/qtbase/src/plugins/sqldrivers“ wird verlassen
    Makefile:54: recipe for target 'sub-sqldrivers-make_first' failed
    make[3]: *** [sub-sqldrivers-make_first] Error 2
    make[3]: Verzeichnis „/home/dennis/Qt/5.14.1/Src/qtbase/src/plugins“ wird verlassen
    Makefile:777: recipe for target 'sub-plugins-make_first' failed
    make[2]: *** [sub-plugins-make_first] Error 2
    make[2]: Verzeichnis „/home/dennis/Qt/5.14.1/Src/qtbase/src“ wird verlassen
    Makefile:50: recipe for target 'sub-src-make_first' failed
    make[1]: *** [sub-src-make_first] Error 2
    make[1]: Verzeichnis „/home/dennis/Qt/5.14.1/Src/qtbase“ wird verlassen
    Makefile:87: recipe for target 'module-qtbase-make_first' failed
    make: *** [module-qtbase-make_first] Error 2
    

    Kann mir hierbei jemand helfen?
    Ich denke der Fehler liegt in dieser Zeile "Project ERROR: Could not find feature dlopen".
    Gegooglt habe ich natürlich auch. Leider konnte ich nichts finden.

    Unter Windows bekomme ich noch merkwürdige Fehlermeldungen. Aus diesem Grund bin ich auf VirtualBox mit Ubuntu umgestiegen.

    Gruß
    Dennis


  • Lifetime Qt Champion

    @rs_freak93 said in Problem beim Erstellen des mysqldriver dlopen:

    sudo ./configure -sql-mysql

    1. sudo???
    2. Bitte an die Anleitung halten: https://doc.qt.io/qt-5/sql-driver.html


  • Ich habe das Problem gelöst. Ich musste nur die erstellte libqsqlmysql.so in einige Ordener kopieren.
    Siehe folgende Anleitung:
    https://stackoverflow.com/questions/39296966/there-is-an-error-cannot-create-moc-main-moc-when-i-compile-the-mysql-drive

    Trotzdem Danke für die Hilfe!


  • Lifetime Qt Champion

    Die Anleitung is falsch / macht unnötige Dinge - weder sudo noch cp ist nötig - make install ist genug.


Log in to reply