简体   繁体   中英

cross compiling qt: Error while loading shared libraries

last week I recieved my brand new Colibri VF61 with the Aster carrier board from Toradex. I followed Toradex's guide on how to prepare the board to cross compile with qt here .

Everything from the tuturial went perfect, however I tried deploying my app and everything goes fine until I open the executable on my target device because I get the following message :

error while loading shared libraries: libQt5PrintSupport.so.5: cannot open shared object file: No such file or directory

I went to see if I had any Qt files in my target device at all, and there weren't so I went to my sysroot folder in my host device and I copied all the Qt files to my target device, (Qt5PrintSupport was there) but after I copied all the files in the exact same location as they where in my sysroot the same error keep appearing.

The files I copied were:

LibIcal Qt5Core Qt5OpenGLExtensions Qt5Svg PulseAudio Qt5DBus Qt5Positioning Qt5SystemInfo Qt5 Qt5Declarative Qt5PrintSupport Qt5Test Qt53DCore Qt5Designer Qt5PublishSubscribe Qt5UiPlugin Qt53DExtras Qt5Enginio Qt5Qml Qt5UiTools Qt53DInput Qt5Gui Qt5Quick Qt5WebChannel Qt53DLogic Qt5Help Qt5QuickTest Qt5WebKit Qt53DQuick Qt5LinguistTools Qt5QuickWidgets Qt5WebKitWidgets Qt53DQuickExtras Qt5Location Qt5Script Qt5WebSockets Qt53DQuickInput Qt5Multimedia Qt5ScriptTools Qt5Widgets Qt53DQuickRender Qt5MultimediaWidgets Qt5Sensors Qt5X11Extras Qt53DRender Qt5Network Qt5SerialPort Qt5Xml Qt5Bluetooth Qt5Nfc Qt5ServiceFramework Qt5XmlPatterns Qt5Concurrent Qt5OpenGL Qt5Sql libxml2

Inside /usr/lib/cmake

and:

imports libexec mkspecs plugins qml

folders to /usr/lib/qt5

I have noticed that the problem may be that I dont have the "lib" folder inside /usr/lib/qt5 however I don't know how to create it since it wasn't in my sysroot.

Summing up: I want to execute my app by cross compiling but the lib folder is missing and I don't know how to create it or link it.

Having a library in the same path with the app using it doesn't necessarily mean that your app can find it. Follow one of the methods below;

  • Install the required qt libraries into system's standard lib directory(eg /usr/lib/)
  • Set environment variable LD_LIBRARY_PATH to where your qt libraries exist. Convention is generally having a bash script setting it then launching your app) or
  • At compile time, you set rpath variable to the location of qt libraries folder (-rpath for gcc)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM