Solved Qt CrossCompile on raspberry pi shared library not found
-
If you are not working with different OS' I would not use too many switches. Just a personal advice.
I am typically working on windows. However, as far as I remember is home some sort of a short cut which is being expended by the OS repectively the terminal you are using.
If I am not completely wrong, you should try to use the complete name of the folder.
-
@koahnig
thte error I'm getting is/home/andrei/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lfirstPlugIn
Tried everithing I could think of including
unix:QMAKE_RPATHDIR += /home/pi/myApp
nothing is working
-
Sorry, just saw that my memory failed on home. Again I am working on Windows and linux is scarcely used by me.
According to the qmake manual the -L part, resepctively teh actual path does not have a slash at the end. Not sure if that could be the problem.
Another issue are typically the names used. In that respect windows is less strict. -
@koahnig
the problem that I have is that on my PC I'm using a different pathe compared to RPI. maybe this is the problem .. but my program is intended to run on RPI.. so it has to be there.. and it has to be cross compiled and not native compiled... any sugestions?? -
@arsinte_andrei
I have posted a link to this post for someone else from the moderators. I have not enough knowledge to be of help, I fear. -
@koahnig
It create:firstPlugIn.so firstPlugIn.so.1 firstPlugIn.so.1.0 firstPlugIn.so.1.0.0
but only the last one is the actual file, all other are just the links to it made by compiler (Qt Creator - qmake)
and also it put this files in the corect folder where they should be
remote pi: /home/pi/myApp/ -
After a long and long search and searching others code I've found out how to make it work...
CONFIG(debug, debug|release) { ROUTDIR = debug } else { ROUTDIR = release } CONFIG(plugin, plugin) { build_pass:CONFIG(debug, debug|release) { TARGET = $$join(TARGET,,,_debug) # Qt uses '_debug' for unix and 'd' for Windows # which is not reliably detectable (e.g.: abcd.dll) # unix: TARGET = $$join(TARGET,,,_debug) # else: TARGET = $$join(TARGET,,,d) } } CONFIG -= warn_off CONFIG += warn_on CONFIG += debug_and_release ordered embed_manifest_dll embed_manifest_exe target.path = /home/pi/myApp INSTALLS += target DESTDIR = $$PWD/$$ROUTDIR LIBS += -L$$PWD/$$ROUTDIR INCLUDEPATH += \ $$PWD/myApp\ $$PWD/firstPlugIn\ $$PWD/secondPlugIn\ $$PWD/thirdPlugIn LIBS += \ -lfirstPlugIn \ -lsecondPlugIn -lthirdPlugIn
now is working on both... PC and raspberry pi
Many thanks for all hep -
Thank you for updating so others can learn from it.
-
-
Hi,
IIRC, you can use
$$qtLibraryTarget(name_of_the_library)
to get the name of the library with the correct extension. -
Hi, I am having simmilar problem to yours: https://forum.qt.io/topic/72844/could-not-load-shared-library-symbols
When I debug it still cannot find the symbols. I tried to set the LD_LIBRARY_PATH to /home/pi/ (this is where my executable is on the Raspberry Pi) but nothing changes. Could I please ask for help?EDIT: I have partially solved the problem in the linked topic, maybe someone will find it usefull.