Correct way to use external lib in cross compiling like curses
-
Hi All,
I have a project which is running in i386 linux and arm linux (wandboard debian hf) too.
In i386 I can use curses very easy.in .pro: unix:!macx: LIBS += -lncurses
There is a debian distrib on the arm device, where installed curses too from package.
/usr/lib/arm-linux-gnueabihf/
libncurses.so
libncurses.a
libncurses++.aI would like to crosscompiling in i386 debian linux device with linaro arm cross compiler.
When I want to crosscompiling to arm debian it said: curses.h not found.
Its correct because cc uses its own include and lib dirs.I tried:
-
copy curses.h to linaro_root/arm-linux-gnueabihf/libc/usr/include
-
copy libncurses* libs to linaro_root/arm-linux-gnueabihf/libc/usr/lib/arm-linux-gnueabihf dir
After that compiler can compile, but cannot links: cannot find libncurses.so.5
maybe it is not the correct way to set external lib?
How can I set an external lib to use in arm crosscompiling?
thx a lot
Zamek -
-
I found a libncurses.so.5 in /usr/lib directory of arm device.
After I copied it into the lib of linaro directory, compiler missed tinfo lib.
I found an libtinfo.a and I copied it into linaro.
Finally I can compile the arm target and it works well, but I don't think it is a correct way. -
Hi,
Technically, you need to provide your cross-compiling environment with the missing libraries/headers in order to build. One way is to cross-compile all dependencies and install them in your cross-compiling environment or get pre-built packages like those from debian's armel port. Also depending on what you use to generate the root fs (e.g. the yocto project) you would just need to add these packages.
Hope it helps