#描述
平台:PC
系統:ubuntu18.04
Qt Version:4.8.5
症狀:之前在用戶下安裝的qtcreator和qt4.8.5可以運行,但是改為root下運行后(修改正確了qt版本和編譯鏈地址),
Qt程序可以正常運行,界面渲染出現問題以及亂碼,控制提示錯誤內容:
“unable to attach to shared memory segment.”
“X Error:BadDrawable (individ Pixmap or Window parameter 9)”
原因沒有深究,百度一下,添加這個變量就可以
#解決
export QT_X11_NO_MITSHM=1
也可以在環境里添加
$ sudo vim /etc/environment
在末尾添加QT_X11_NO_MITSHM=1保存退出后即可正常啟動。
參考
https://stackoverflow.com/questions/12829402/qt-errors-after-static-compilation
https://stackoverflow.com/questions/51818078/x-error-baddrawable-invalid-pixmap-or-window-parameter-when-launching-apache
add this line QT_X11_NO_MITSHM=1 in system env var.
In my case environment file location is : etc/environment