Qt GUI app not running in container. Error : /lib/x86_64-linux-gnu/libQt6Core.so.6: version `Qt_6.8’ not found (required by ./<GUI_App>)

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello Siddhartha,

Thank you for reaching out with your question. It sounds like you’re encountering a version mismatch issue with your Qt GUI application inside a Docker container. Let’s work through this step-by-step to resolve the problem.

  1. Verify Installed Qt Version: First, confirm the version of Qt installed in your Docker container. You can do this by running qmake --version or checking the library files directly. Ensure it matches the required version, Qt 6.8.2.

  2. Install the Correct Qt Version: If the required version isn’t installed, you’ll need to add the appropriate Qt repository to your Dockerfile and install the specific version. For Debian-based images, you might use:

    RUN apt-get update && apt-get install -y qt6-base-dev
    

    Ensure this installs the correct version by specifying the version number if necessary.

  3. Set LD_LIBRARY_PATH: Make sure the LD_LIBRARY_PATH environment variable includes the path to the Qt libraries. You can set this in your Dockerfile:

    ENV LD_LIBRARY_PATH=/path/to/qt/lib:$LD_LIBRARY_PATH
    

    Replace /path/to/qt/lib with the actual path where the Qt libraries are installed.

  4. Rebuild Your Docker Image: After making these changes, rebuild your Docker image to apply them:

    docker build -t your_image_name .
    
  5. Run the Container with Correct Settings: When running the container, ensure you map the display correctly:

    docker run -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY -it your_image_name
    

By following these steps, you should be able to resolve the version mismatch and run your Qt GUI application successfully. If you continue to experience issues, double-check the library paths and ensure all dependencies are correctly installed.

I hope this helps! Feel free to reach out if you have any more questions.

Best regards,
Toradex AI Assistant

Please, also check if these links can help you solve your problem:

Unable to load GIFs in Qt on Hardware, works in QtCreator.