Title: Resolving Ubuntu 20.04 WSL1: UI Cannot Run - Error: /usr/lib/qt5/bin/uic: Error Loading Shared Libraries: libQt5Core.so.5: Not Openshared Object File: No File Directory
Introduction
This article aims to guide users through resolving the issue of UI Cannot Run error on Ubuntu 20.04 WSL1, specifically the error: /usr/lib/qt5/bin/uic: Error Loading Shared Libraries: libQt5Core.so.5: Not Openshared Object File: No File Directory.
Problem Description
Users encountering this issue are unable to run the uic command, which is a part of the Qt library, due to a missing or incorrectly linked shared library (libQt5Core.so.5).
Cause
The cause of this issue is not explicitly defined, but it might be due to a missing or broken installation of the Qt library, or a mismatch between the installed version and the required version.
Solution
1. Install the Required Qt Library
First, ensure that you have the necessary dependencies installed. If not, install them using the following command:
sudo apt-get install qtbase5-dev
2. Check the Qt Version
Check the installed Qt version using the following command:
qtenv
If the installed version is different from the required version, uninstall the current version and install the required version. For example, if you need Qt 5.12.8, install it using:
sudo apt-get install qtbase5-dev-tools qtbase5-dev-tools-dev qtbase5-dev-tools-private qtbase5-dev-tools-private-dev qtbase5-dev-tools-private-doc qtbase5-dev-tools-private-doc-html qtbase5-dev-tools-private-doc-pdf qtbase5-dev-tools-private-doc-ps qtbase5-dev-tools-private-doc-txt qtbase5-dev-tools-private-doc-pdf-extra qtbase5-dev-tools-private-doc-ps-extra qtbase5-dev-tools-private-doc-txt-extra qtbase5-dev-tools-private-doc-html-extra qtbase5-dev-tools-private-doc-pdf-extra-dev qtbase5-dev-tools-private-doc-ps-extra-dev qtbase5-dev-tools-private-doc-txt-extra-dev qtbase5-dev-tools-private-doc-html-extra-dev qtbase5-dev-tools-private5.12.8
3. Check the LD_LIBRARY_PATH
Check if the LD_LIBRARY_PATH environment variable is set correctly. If not, set it to the Qt library path:
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/qt5/lib:$LD_LIBRARY_PATH
4. Run the UI Compiler
Now, you should be able to run the uic command without any errors.
Summary
- Ensure that you have the necessary dependencies installed.
- Check the installed Qt version and install the required version if needed.
- Check the LD_LIBRARY_PATH and set it to the Qt library path if necessary.
- Run the UI compiler (
uic).