As you possibly know now from my multiple topics, I’m embedding Qt 4.7.4 on an ARM system ; I just have one last problem. =/
I wrote a library that is using Qt and that I compile with qmake, in order to obtain a .so file ; that works. Then I wrote a soft that should use this library, and that I compile with a classical make. The problem is, when I try to compile this soft, I get a lot of “undefined reference” from my library ; all Qt elements are missing in fact. I saw that Qt libs are not found :
/usr/local/lib/star81xx-lsdk/tools/usr/bin/../lib/gcc/arm-linux-uclibc/4.2.3/../../../../arm-linux-uclibc/bin/ld: warning: libQtGui.so.4, needed by /home/jdl/workspace-install/MY_ARM_SYSTEM/fs/usr/lib/myLib.so, not found (try using -rpath or -rpath-link)
/usr/local/lib/star81xx-lsdk/tools/usr/bin/../lib/gcc/arm-linux-uclibc/4.2.3/../../../../arm-linux-uclibc/bin/ld: warning: libQtNetwork.so.4, needed by /home/jdl/workspace-install/MY_ARM_SYSTEM/fs/usr/lib/myLib.so, not found (try using -rpath or -rpath-link)
/usr/local/lib/star81xx-lsdk/tools/usr/bin/../lib/gcc/arm-linux-uclibc/4.2.3/../../../../arm-linux-uclibc/bin/ld: warning: libQtCore.so.4, needed by /home/jdl/workspace-install/MY_ARM_SYSTEM/fs/usr/lib/myLib.so, not found (try using -rpath or -rpath-link)
Why did myLib compile good if it doesn’t know where Qt libs are ? Can I add it manually to my soft Makefile ?
Thanks !
When compiling through cmd-line, you need to add
-Lto specify the path where libQtGui.so.4 and the others are, then add-lQtGui -lQtNetwork -lQtCoreso that these libraries are linked to your application.