Cannot Open libQt6OpenGLWidgets.so.6

If the message: “error while loading shared libraries: libQt6OpenGLWidgets.so.6: cannot open shared object file: No such file or directory” pops should I reinstall qt? Even if this directory is there…

Thank you

I search qt like this:

  set(qt_components Core Gui Widgets)
  if(${VTK_QT_VERSION} VERSION_GREATER_EQUAL 6)
    list(APPEND qt_components OpenGLWidgets)
  endif()
  
  
  list(SORT qt_components)
  # We have ui files, so this will also bring in the macro:
  #   qt5_wrap_ui or qt_wrap_ui from Widgets.
  find_package(Qt6 QUIET
    REQUIRED COMPONENTS ${qt_components} OpenGLWidgets Core Gui Widgets
  )
  
  foreach(_qt_comp IN LISTS qt_components)
    list(APPEND qt_modules "Qt${VTK_QT_VERSION}::${_qt_comp}")
  endforeach()

The file is defenitely there:

image

Hello,

I think find_package(Qt6 ...) should be placed before any reference to Qt configuration is made.

take care,

Paulo