SW Level Up
QtCreator가 실행이 안되는 문제 해결 본문
문제
QtCreator 아이콘을 누르면 아무 반응이 없고 터미널로 실행하면 아래와 같은 오류가 나온다.
❯ Qt/Tools/QtCreator/bin/qtcreator
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
[1] 31115 abort (core dumped) Qt/Tools/QtCreator/bin/qtcreator
요약
필요한 라이브러리가 없어서 발생한 문제이다. libxcb-xinerama0 라이브러리를 설치하면 된다.
sudo apt install libxcb-xinerama0-dev
이걸로 해결되지 않는다면 본문에서 어떻게 원인을 찾는지 알아보자.
터미널로 QtCreator를 실행해서 얻은 오류 내용이 별로 도움이 되지 않는다.
먼저 자세한 오류 내용을 얻어보자. 터미널에 아래 export 문을 입력하고 실행한다.
export QT_DEBUG_PLUGINS=1
다시 터미널로 QtCreator를 실행하면 많은 양의 출력 결과를 볼 수 있다.
어디를 주목해야 하는지 바로 설명할 것이니 아래의 많은 내용은 대충 넘어가면 된다.
❯ Qt/Tools/QtCreator/bin/qtcreator
QFactoryLoader::QFactoryLoader() checking directory path "/home/tj/Qt/Tools/QtCreator/lib/Qt/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() looking at "/home/tj/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqeglfs.so"
Found metadata in lib /home/tj/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqeglfs.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"eglfs"
]
},
"archreq": 0,
"className": "QEglFSIntegrationPlugin",
"debug": false,
"version": 331520
}
... 이하 생략 ...
Got keys from plugin meta data ("vnc")
QFactoryLoader::QFactoryLoader() looking at "/home/tj/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so"
Found metadata in lib /home/tj/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"xcb"
]
},
"archreq": 0,
"className": "QXcbIntegrationPlugin",
"debug": false,
"version": 331520
}
Got keys from plugin meta data ("xcb")
QFactoryLoader::QFactoryLoader() checking directory path "/home/tj/Qt/Tools/QtCreator/bin/platforms" ...
Cannot load library /home/tj/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so: (libxcb-xinerama.so.0: cannot open shared object file: No such file or directory)
QLibraryPrivate::loadPlugin failed on "/home/tj/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so" : "Cannot load library /home/tj/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so: (libxcb-xinerama.so.0: cannot open shared object file: No such file or directory)"
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
[1] 31149 abort (core dumped) Qt/Tools/QtCreator/bin/qtcreator
주목할 곳은 거의 맨 아래의 Cannot load library 부분이다.
Cannot load library /home/tj/Qt/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so: (libxcb-xinerama.so.0: cannot open shared object file: No such file or directory)
libxcb-xinerama.so.0 공유 라이브러리가 없는 게 문제라는 것을 알 수 있다. 설치해보자.
# 찾기
apt search libxcb-xinerama
# 설치
sudo apt install libxcb-xinerama0-dev
아래는 실행 결과이다.
❯ apt search libxcb-xinerama
Sorting... Done
Full Text Search... Done
libxcb-xinerama0/focal 1.14-2 amd64
X C Binding, xinerama extension
libxcb-xinerama0-dev/focal 1.14-2 amd64
X C Binding, xinerama extension, development files
❯ sudo apt install libxcb-xinerama0-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libpthread-stubs0-dev libxau-dev libxcb-xinerama0 libxcb1-dev libxdmcp-dev x11proto-core-dev x11proto-dev xorg-sgml-doctools
Suggested packages:
libxcb-doc
The following NEW packages will be installed:
libpthread-stubs0-dev libxau-dev libxcb-xinerama0 libxcb-xinerama0-dev libxcb1-dev libxdmcp-dev x11proto-core-dev x11proto-dev xorg-sgml-doctools
0 upgraded, 9 newly installed, 0 to remove and 0 not upgraded.
Need to get 741 kB of archives.
After this operation, 2,742 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
... 이하 생략 ...
이제 QtCreator가 제대로 실행된다.
'개발 환경' 카테고리의 다른 글
비주얼 스튜디오 2019 설치 및 콘솔 응용 프로그램 프로젝트 만들기 (0) | 2020.10.01 |
---|---|
oh my zsh과 플러그인으로 쉘 또는 터미널 환경 꾸미기 (0) | 2020.09.15 |
Comments