在重新安装ros之后,并运行小海龟节点测试的时候出现了:
QFactoryLoader::QFactoryLoader() checking directory path "/opt/ros/melodic/lib/turtlesim/platforms" ...
This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".
Reinstalling the application may fix this problem.
Aborted (core dumped)
参考:“Failed to load platform plugin ”xcb“ ” while launching qt5 app on linux without qt installed
执行
sudo apt-get install --reinstall libxcb-xinerama0
但毫无用处
随后参考:linux解决加载Qt xcb plugins失败
按照作者的说法,新安装的qt环境,但没有将qt库目录添加到环境变量LD_LIBRARY_PATH, 于是我在.bashrc的末尾添加:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/Qt5.9.8/5.9.8/gcc_64/lib
重新测试,成功