I am trying to port my Qt code from Linux to embedded linux. Now I looked online and I came across this document on how to deploy onto embedded linux/linux: http://doc.qt.io/archives/qt-4.7/deployment-x11.html
So now I use the shared-library approach since 开发者_JS百科I think that will give me the most flexibility and also it seems that with the latest QtSDK I cannot deploy my application statically. I follow all the steps mentioned in the instructions and I have no plugins. So when I finish the steps I port all my code and the dependent libraries to a certain directory: /tmp/MyFolder.... I determine the libraries I need to port using ldd -v Application.exe. So now the thing is when I port the libraries onto embedded linux box I notice that some of those libraries already exist in directories such as /usr/lib and /lib. So when I run my code I write a shell script to modify the LD_LIBRARY_PATH environment variable to check those directories and my own directory for the appropriate libraries. Now when I run my code on the embedded linux box I get the error:
Error while loading shared libraries: /tmp/ftproot/RenderingEngine/./libm.so.6: ELF file OS ABI invalid.
I have tried googling the error but I still don't know what this error means and how to resolve it. The thing is the library libm.so.6 is in the /usr/lib directory and my custom directory as well. However, the way I set my LD_LIBRARY_PATH it checks my custom directory first. Could someone help me with this please?
The ELF error indicates that you have linked to libraries that are in an incompatible binary format for your system. You should only link to libraries that were compiled for the target OS (in this case whatever version of embedded Linux).
Try recompiling your code and link to the libraries that were already present on your system (i.e. in /usr/lib
).
精彩评论