Cross-compile Qt5 with tslib: Feature 'tslib' was enabled, but the pre-condition 'libs.tslib' failed
-
I cross-compiled Qt5.12.11 for arm without the tslib support, and it was successful.
Now, I need to add the tslib support. I have the tslib already cross-compiled for my target architecture. I add the -tslib to my configure in this way, specifying the include and lib path with -I and -L:./configure -opensource -confirm-license -xplatform arm-cortex_a8-linux-gnueabi-g++ -prefix myInstallDir/ -no-opengl -no-pch -I /path/to/tslib/include/ -L /path/to/tslib/lib/ -tslib
The configure always fails with the following output error:
ERROR: Feature 'tslib' was enabled, but the pre-condition 'libs.tslib' failed.
In the configure.log I can see the following:
loaded result for library config.qtbase_gui.libraries.tslib Trying source 0 (type inline) of library tslib ... None of [libts.so libts.a] found in [] and global paths. => source produced no result. test config.qtbase_gui.libraries.tslib FAILED
I tryied to add in my qtbase/mkspecs/arm-cortex_a8-linux-gnueabi-g++/qmake.conf the following lines:
QMAKE_INCDIR += /path/to/tslib/include/ QMAKE_LIBDIR += /path/to/tslib/lib/
without any success.
I also tryied to add /path/to/tslib/lib to LD_LIBRARY_PATH environment path, but nothing changes.
is it a problem related to the localization of the tslib lib & include paths?
can anyone give me a suggestion please?
Thank you. -
Hi and welcome to devnet,
Did you also check the configure tests to see if there's more information there ?
-
-
@jsulm In the configure.log I can see the following about tslib:
loaded result for library config.qtbase_gui.libraries.tslib Trying source 0 (type inline) of library tslib ... None of [libts.so libts.a] found in [] and global paths. => source produced no result. test config.qtbase_gui.libraries.tslib FAILED
-
@sitti said in Cross-compile Qt5 with tslib: Feature 'tslib' was enabled, but the pre-condition 'libs.tslib' failed:
None of [libts.so libts.a] found in [] and global paths.
It can't find libts.so
Can you post the whole tslib test output? It should actually try to build a small application linking against tslib. -
@sitti
You do not need-I
and-L
flags on Qt configure, neither the QMAKE_* variables in your mkspecs file.Most stuff in configure is handled via pkgconfig, but it seems not so for tslib
If it would be handled via pkgconfig sometime it needs to be guided in the right direction (for armhf packages):export PKG_CONFIG_PATH=/usr/local/lib/arm-linux-gnueabihf/pkgconfig:/usr/lib/arm-linux-gnueabihf/pkgconfig:$PKG_CONFIG_PATH
whats your host system?
When you are on a Debian based system are you sure you installedlibts-dev:armhf
? -
@raven-worx Hi, my host system is Ubuntu 20.04.3 LTS
If it would be handled via pkgconfig sometime it needs to be guided in the right direction (for armhf packages):
Is there a way to understand how tslib can be configured in a cross compiled Qt build?
are you sure you installed libts-dev:armhf
libts-dev is installed. If I dosudo apt install libts-dev:armhf
it says it doesn't find libts-dev:armhf packet.
Thanks -
@sitti
https://packages.debian.org/de/buster/libts-devmaybe run
apt update
beforehand.Do you even have the armhf repositories added in your system at all?!
-
@raven-worx libts-dev is present in my host system.
I already have the tslib cross-compiled for my ARM target device. I am looking for a way to make the Qt build aware of tslib. Adding -tslib to the configure line sees to be not sufficient.. -
@sitti
ok where exactly did you put the output of cross compiled tslib?
Make sure its in one of the compilers/hosts default search paths.
e.g./usr/local/lib/arm-linux-gnueabihf
and/usr/local/include/
-
@raven-worx currently they are in a custom path, and I was trying to add those paths to the search path, but without success for now. By the way, now I will add the libts and its header to the paths you suggested.
-
@raven-worx said in Cross-compile Qt5 with tslib: Feature 'tslib' was enabled, but the pre-condition 'libs.tslib' failed:
compilers/hosts default search paths.
i am still stuck trying to cross-compile qt with the library. I also tried to give the -sysroot option to my configure command, after copying my libts.so and tslib.h in sysroot lib/ and include/ directory:
./configure -opensource -confirm-license -xplatform arm-cortex_a8-linux-gnueabi-g++ -prefix test1/ -sysroot /home/andrea/cross-compiler/toolchain_arm/arm-cortex_a8-linux-gnueabi/sysroot -no-opengl -no-pch -no-evdev -tslib
The configure.log always says:
loaded result for library config.qtbase_gui.libraries.tslib Trying source 0 (type inline) of library tslib ... None of [libts.so libts.a] found in [] and global paths. => source produced no result. test config.qtbase_gui.libraries.tslib FAILED
How can I tell to qt configure where to find my tslib?
-
@sitti
Remove the sysroot parameter.as i mentioned a few posts above, Qt tries to compile the following simple "project" and checks if the compiler returns and exit code unequal 0:
#include <tslib.h> int main() { ts_open("foo", 0); }
try to compile it with the following comand to see where it is failing:
arm-cortex_a8-linux-gnueabi-g++ tslib_test.cpp -lts
Also please post the output of:
arm-cortex_a8-linux-gnueabi-g++ -E -x c++ - -v < /dev/null
This prints the include directories used by the compiler.
-
The simple tslib program is compiled apparently without any issue, an a.out executable has been created.
The commandarm-cortex_a8-linux-gnueabi-g++ -E -x c++ - -v < /dev/null
gives the following output:
Using built-in specs. COLLECT_GCC=arm-cortex_a8-linux-gnueabi-g++ Target: arm-cortex_a8-linux-gnueabi Configured with: /home/francesco/devel/tastiera_arm/linux/buildroot/cross_compiler/crosstool-ng-1.19.0/target/src/gcc-linaro-4.8-2013.06-1/configure --build=i686-build_pc-linux-gnu --host=i686-build_pc-linux-gnu --target=arm-cortex_a8-linux-gnueabi --prefix=/home/francesco/devel/tastiera_arm/linux/buildroot/cross_compiler/crosstool-ng-1.19.0/opt/toolchain_arm --with-sysroot=/home/francesco/devel/tastiera_arm/linux/buildroot/cross_compiler/crosstool-ng-1.19.0/opt/toolchain_arm/arm-cortex_a8-linux-gnueabi/sysroot --enable-languages=c,c++,java --with-cpu=cortex-a8 --with-tune=cortex-a8 --with-fpu=vfpv3 --with-float=hard --with-pkgversion='crosstool-NG 1.19.0' --enable-__cxa_atexit --disable-libmudflap --disable-libgomp --disable-libssp --disable-libquadmath --disable-libquadmath-support --with-gmp=/home/francesco/devel/tastiera_arm/linux/buildroot/cross_compiler/crosstool-ng-1.19.0/target/arm-cortex_a8-linux-gnueabi/buildtools --with-mpfr=/home/francesco/devel/tastiera_arm/linux/buildroot/cross_compiler/crosstool-ng-1.19.0/target/arm-cortex_a8-linux-gnueabi/buildtools --with-mpc=/home/francesco/devel/tastiera_arm/linux/buildroot/cross_compiler/crosstool-ng-1.19.0/target/arm-cortex_a8-linux-gnueabi/buildtools --with-isl=/home/francesco/devel/tastiera_arm/linux/buildroot/cross_compiler/crosstool-ng-1.19.0/target/arm-cortex_a8-linux-gnueabi/buildtools --with-cloog=/home/francesco/devel/tastiera_arm/linux/buildroot/cross_compiler/crosstool-ng-1.19.0/target/arm-cortex_a8-linux-gnueabi/buildtools --with-libelf=/home/francesco/devel/tastiera_arm/linux/buildroot/cross_compiler/crosstool-ng-1.19.0/target/arm-cortex_a8-linux-gnueabi/buildtools --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --enable-threads=posix --enable-target-optspace --disable-nls --disable-multilib --with-local-prefix=/home/francesco/devel/tastiera_arm/linux/buildroot/cross_compiler/crosstool-ng-1.19.0/opt/toolchain_arm/arm-cortex_a8-linux-gnueabi/sysroot --enable-c99 --enable-long-long --with-float=hard Thread model: posix gcc version 4.8.2 20130603 (prerelease) (crosstool-NG 1.19.0) COLLECT_GCC_OPTIONS='-E' '-v' '-shared-libgcc' '-mcpu=cortex-a8' '-mfloat-abi=hard' '-mfpu=vfpv3' '-mtls-dialect=gnu' /home/andrea/cross-compiler/toolchain_arm/bin/../libexec/gcc/arm-cortex_a8-linux-gnueabi/4.8.2/cc1plus -E -quiet -v -iprefix /home/andrea/cross-compiler/toolchain_arm/bin/../lib/gcc/arm-cortex_a8-linux-gnueabi/4.8.2/ -isysroot /home/andrea/cross-compiler/toolchain_arm/bin/../arm-cortex_a8-linux-gnueabi/sysroot -D_GNU_SOURCE - -mcpu=cortex-a8 -mfloat-abi=hard -mfpu=vfpv3 -mtls-dialect=gnu ignoring duplicate directory "/home/andrea/cross-compiler/toolchain_arm/bin/../lib/gcc/../../lib/gcc/arm-cortex_a8-linux-gnueabi/4.8.2/../../../../arm-cortex_a8-linux-gnueabi/include/c++/4.8.2" ignoring duplicate directory "/home/andrea/cross-compiler/toolchain_arm/bin/../lib/gcc/../../lib/gcc/arm-cortex_a8-linux-gnueabi/4.8.2/../../../../arm-cortex_a8-linux-gnueabi/include/c++/4.8.2/arm-cortex_a8-linux-gnueabi" ignoring duplicate directory "/home/andrea/cross-compiler/toolchain_arm/bin/../lib/gcc/../../lib/gcc/arm-cortex_a8-linux-gnueabi/4.8.2/../../../../arm-cortex_a8-linux-gnueabi/include/c++/4.8.2/backward" ignoring duplicate directory "/home/andrea/cross-compiler/toolchain_arm/bin/../lib/gcc/../../lib/gcc/arm-cortex_a8-linux-gnueabi/4.8.2/include" ignoring nonexistent directory "/home/andrea/cross-compiler/toolchain_arm/bin/../arm-cortex_a8-linux-gnueabi/sysroot/home/francesco/devel/tastiera_arm/linux/buildroot/cross_compiler/crosstool-ng-1.19.0/opt/toolchain_arm/arm-cortex_a8-linux-gnueabi/sysroot/include" ignoring duplicate directory "/home/andrea/cross-compiler/toolchain_arm/bin/../lib/gcc/../../lib/gcc/arm-cortex_a8-linux-gnueabi/4.8.2/include-fixed" ignoring duplicate directory "/home/andrea/cross-compiler/toolchain_arm/bin/../lib/gcc/../../lib/gcc/arm-cortex_a8-linux-gnueabi/4.8.2/../../../../arm-cortex_a8-linux-gnueabi/include" #include "..." search starts here: #include <...> search starts here: /home/andrea/cross-compiler/toolchain_arm/bin/../lib/gcc/arm-cortex_a8-linux-gnueabi/4.8.2/../../../../arm-cortex_a8-linux-gnueabi/include/c++/4.8.2 /home/andrea/cross-compiler/toolchain_arm/bin/../lib/gcc/arm-cortex_a8-linux-gnueabi/4.8.2/../../../../arm-cortex_a8-linux-gnueabi/include/c++/4.8.2/arm-cortex_a8-linux-gnueabi /home/andrea/cross-compiler/toolchain_arm/bin/../lib/gcc/arm-cortex_a8-linux-gnueabi/4.8.2/../../../../arm-cortex_a8-linux-gnueabi/include/c++/4.8.2/backward /home/andrea/cross-compiler/toolchain_arm/bin/../lib/gcc/arm-cortex_a8-linux-gnueabi/4.8.2/include /home/andrea/cross-compiler/toolchain_arm/bin/../lib/gcc/arm-cortex_a8-linux-gnueabi/4.8.2/include-fixed /home/andrea/cross-compiler/toolchain_arm/bin/../lib/gcc/arm-cortex_a8-linux-gnueabi/4.8.2/../../../../arm-cortex_a8-linux-gnueabi/include /home/andrea/cross-compiler/toolchain_arm/bin/../arm-cortex_a8-linux-gnueabi/sysroot/usr/include End of search list. # 1 "<stdin>" # 1 "<command-line>" # 1 "/home/andrea/cross-compiler/toolchain_arm/arm-cortex_a8-linux-gnueabi/sysroot/usr/include/stdc-predef.h" 1 3 4 # 1 "<command-line>" 2 # 1 "<stdin>" COMPILER_PATH=/home/andrea/cross-compiler/toolchain_arm/bin/../libexec/gcc/arm-cortex_a8-linux-gnueabi/4.8.2/:/home/andrea/cross-compiler/toolchain_arm/bin/../libexec/gcc/:/home/andrea/cross-compiler/toolchain_arm/bin/../lib/gcc/arm-cortex_a8-linux-gnueabi/4.8.2/../../../../arm-cortex_a8-linux-gnueabi/bin/ LIBRARY_PATH=/home/andrea/cross-compiler/toolchain_arm/bin/../lib/gcc/arm-cortex_a8-linux-gnueabi/4.8.2/:/home/andrea/cross-compiler/toolchain_arm/bin/../lib/gcc/:/home/andrea/cross-compiler/toolchain_arm/bin/../lib/gcc/arm-cortex_a8-linux-gnueabi/4.8.2/../../../../arm-cortex_a8-linux-gnueabi/lib/:/home/andrea/cross-compiler/toolchain_arm/bin/../arm-cortex_a8-linux-gnueabi/sysroot/lib/:/home/andrea/cross-compiler/toolchain_arm/bin/../arm-cortex_a8-linux-gnueabi/sysroot/usr/lib/ COLLECT_GCC_OPTIONS='-E' '-v' '-shared-libgcc' '-mcpu=cortex-a8' '-mfloat-abi=hard' '-mfpu=vfpv3' '-mtls-dialect=gnu'
-
@sitti said in Cross-compile Qt5 with tslib: Feature 'tslib' was enabled, but the pre-condition 'libs.tslib' failed:
The simple tslib program is compiled apparently without any issue, an a.out executable has been created.
ok strange.
are you always deleting your build folder before you calling Qt's configure again and start another build?
-
@raven-worx I configure from inside the source directory (not shadow build). I usually do a make distclean before start another configure+build. Is it ok?
-
@sitti
thats rather bad. better always use a separate build directory when building Qt - so you can easily delete the folder and start over again.
I dont know ifmake dist-clean
really deletes everything which might affect the configure test cache. -
@raven-worx sure that make sense, I just created a parallel build directory, from now on I will follow your suggestion. Lets see if something changes...
-
@sitti
maybe also provide-v
to the configure call. I am not sure if it also prints the used compiler call though.