maplibre-native-qt icon indicating copy to clipboard operation
maplibre-native-qt copied to clipboard

QT 6.5.3 Linux symbol lookup error

Open wecand0 opened this issue 2 years ago • 1 comments

I installed this project to /home/user/Qt/6.5.3/gcc_64

Try to compile example with widjets, the error is symbol lookup error: /lib/x86_64-linux-gnu/libQt6OpenGL.so.6: undefined symbol: _ZNK14QWindowPrivate12shareContextEv, version Qt_6_PRIVATE_API How to fix it? In general QT works under clion from my Qt folder(I installed all default plugins from qt online installer) OS: Mint 21.2 IDE: the latest CLion

My cmake:

cmake_minimum_required(VERSION 3.24)
project(untitled)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)


set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)

set(CMAKE_PREFIX_PATH "/home/user/Qt/6.5.3/gcc_64")

find_package(Qt6 COMPONENTS
        Core
        Gui
        Widgets
        OpenGLWidgets
        REQUIRED)

qt_standard_project_setup()

find_package(QMapLibre COMPONENTS Widgets REQUIRED)

add_executable(untitled main.cpp mainwindow.cpp mainwindow.hpp window.cpp window.hpp)

target_link_libraries(untitled PRIVATE
        Qt6::OpenGLWidgets
        Qt::Core
        Qt::Gui
        Qt::Widgets
        QMapLibre::Widgets
        )

wecand0 avatar Nov 22 '23 14:11 wecand0

I got a similar issue with symbol lookup error, but with libsqlite instead. ./QMapLibreExampleQuick: symbol lookup error: <homedir>/Qt6/6.5.3/gcc_64/plugins/sqldrivers/libqsqlite.so: undefined symbol: _ZN10QSqlDriverC2ER17QSqlDriverPrivateP7QObject, version Qt_6_PRIVATE_API

The program starts when I move "libqsqlite.so" to some other dir. But then I get a lot of "[ WARNING ] "{unknown}Database: Can't write resource: SQLite driver not found."".

Edit

I got this issue when:

  • Qt installed on my operating system (Ubuntu 22.04), Qt is 6.2.4.
  • An other Qt version installed for development, in my case 6.5.4 and 6.6.0.
  • Built the maplibre plugin with 6.5.4 or 6.6.0
  • And trying to run the QML example using Qt 6.5.4 or 6.6.0, without pointing LD_LIBRARY_PATH to the correct version of Qt. Which will result in it trying to use the Qt version installed on the operating system (version 6.2.4) together with the Maplibre plugin built for another version.

To solve the issue I had to point LD_LIBRARY_PATH to both the Maplibre plugin and to the correction version of Qt. The commande to run the QML example looks like this for me: LD_LIBRARY_PATH=<maplibre-install-dir>/lib:<homedir>/Qt6/6.5.3/gcc_64/lib QML_IMPORT_PATH=<maplibre-install-dir>/qml/ QT_PLUGIN_PATH=<maplibre-install-dir>/plugins/ ./QMapLibreExampleQuick

FinitelyFailed avatar Dec 13 '23 12:12 FinitelyFailed

LD_LIBRARY_PATH, QML_IMPORT_PATH and QT_PLUGIN_PATH are now referenced in the documentation.

ntadej avatar Aug 16 '24 05:08 ntadej