Solved Could not load shared library symbols
-
Hello there,
I am following this guide
https://wiki.qt.io/RaspberryPi2EGLFS
to deploy, run and debug qt applications on Raspberry Pi. Deploying and running part works for me, I am having problem with debugging. The debbuger provided with the tutorial does not support python scripting, so I could not use it with qt creator. Because of that, I have installed gdb-multiarch. I have set it in the Qt Creator patch and debug seems to be working, but not fully. When I start to debug, I get the message:Could not load shared library symbols for /usr/local/qt5pi/lib/libQt5Core.so.5. Do you need "set solib-search-path" or "set sysroot"?
Some googling gave me a hint that my LD_LIBRARY_PATH is not set. So In the build tab (in Buld & run) I added a build enviroment variable LD_LIBRARY_PATH with patch to my libs. Now I was not sure which one was the right patch to the correct lib, but I tried all of them in the tutorial (also the remote executable path). Each time I get the error message, like nothing changes. Could someone please help me out with this? I would really appreciate all help.
-
I just found out how to overcome this, not sure either this is the right way of doing this. Seems a bit of a hack for me. Since setting LD_LIBRARY_PATH did not work for me, I tried to do this:
Go to Tools -> Options -> Debugger -> GDB tab -> and in the "Additional Attach Commands" I added:set solib-search-path /home/lukasz/raspi/qt5pi/lib
Where /home/lukasz/raspi/qt5pi/lib is the path to the crosscompiled libraries but on my host pc, not the target Raspberry Pi. Now when I debug there are no error messages. Maybe if someone knows a better way of doing this please post. Hope this helps someone.
-
I just found out how to overcome this, not sure either this is the right way of doing this. Seems a bit of a hack for me. Since setting LD_LIBRARY_PATH did not work for me, I tried to do this:
Go to Tools -> Options -> Debugger -> GDB tab -> and in the "Additional Attach Commands" I added:set solib-search-path /home/lukasz/raspi/qt5pi/lib
Where /home/lukasz/raspi/qt5pi/lib is the path to the crosscompiled libraries but on my host pc, not the target Raspberry Pi. Now when I debug there are no error messages. Maybe if someone knows a better way of doing this please post. Hope this helps someone.
-
Hi Bremenpl,
The standard way of doing this assumes that you have whole filesystem of target machine copied/mounted somewhere in your host machine - rootfs. Rootfs is a parameter of you configured Kit in QtCreator.
If it's not set or you have different structure on your host machine - you have to tell gdb where to look for symbols (using selib-search-path)
-
@Bremenpl I've faced with the same problem. Your solution is work for me too. Thank you!