Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/126.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 交叉编译用于x86_64-linux的Qt4.8.5,禁用xlib-config.test_C++_Qt_Cross Compiling - Fatal编程技术网

C++ 交叉编译用于x86_64-linux的Qt4.8.5,禁用xlib-config.test

C++ 交叉编译用于x86_64-linux的Qt4.8.5,禁用xlib-config.test,c++,qt,cross-compiling,C++,Qt,Cross Compiling,我想在我的LinuxMint 14机器上为运行Linux2.6.32和glibc 2.12.1的X86_64机器编译Qt 4.8.5。我使用crosstool ng创建了一个合适的交叉编译器,并通过这个mkspec(名为linux集群)安装了它 我的配置呼叫是: ../qt-everywhere-opensource-src-4.8.5/configure -device-option CROSS_COMPILE=/<home>/x-tools/x86_64-unknown-linu

我想在我的LinuxMint 14机器上为运行Linux2.6.32和glibc 2.12.1的X86_64机器编译Qt 4.8.5。我使用crosstool ng创建了一个合适的交叉编译器,并通过这个mkspec(名为linux集群)安装了它

我的配置呼叫是:

../qt-everywhere-opensource-src-4.8.5/configure -device-option CROSS_COMPILE=/<home>/x-tools/x86_64-unknown-linux-gnu/bin/x86_64-unknown-linux-gnu- -platform linux-cluster -xplatform linux-cluster -opensource -verbose -prefix /<home>/qt48-install -continue -no-webkit
。/qt-everywhere-opensource-src-4.8.5/configure-device option CROSS\u COMPILE=//x-tools/x86\u 64-unknown-linux-gnu/bin/x86\u 64-unknown-linux-gnu--平台linux集群-xplatform linux集群-开源-详细-前缀//qt48安装-继续-无webkit
Qt似乎使用x86_64-unknown-linux-gnu-g++编译器进行了良好的配置,但随后它执行了一些config.test,例如,它编译了一个失败的测试Xlib应用程序:

x86_64-unknown-linux-gnu-g++ -c -pipe -O2 -Wall -W  -I../../../../qt-everywhere-opensource-src-4.8.5/mkspecs/linux-cluster -I../../../../qt-everywhere-opensource-src-4.8.5/config.tests/x11/xlib -I/usr/include -I../../../../qt-everywhere-opensource-src-4.8.5/config.tests/x11/xlib -I. -o xlib.o ../../../../qt-everywhere-opensource-src-4.8.5/config.tests/x11/xlib/xlib.cpp
x86_64-unknown-linux-gnu-g++ -Wl,-O1 -o xlib xlib.o    -L/usr/lib/x86_64-linux-gnu/  -lXext -lX11 -lm
/<home>/x-tools/x86_64-unknown-linux-gnu/lib/gcc/x86_64-unknown-linux-gnu/4.3.6/../../../../x86_64-unknown-linux-gnu/bin/ld: warning: libxcb.so.1, needed by /usr/lib/x86_64-linux-gnu//libX11.so, not found (try using -rpath or -rpath-link)
x86_64-unknown-linux-gnu-g++-c-pipe-O2-Wall-W-I../../../../qt-everywhere-opensource-src-4.8.5/mkspecs/linux-cluster-I../../qt-everywhere-opensource-src-4.8.5/config.tests/x11/xlib-I/usr/include-xli../../../qt-everywhere-opensource-src-4.8.5/config.tests/x11/ib-I.o.o../../../qt-everywhere-opensource-src-4.8.5/config.tests/x11/xlib/xlib.cpp
x86_64-unknown-linux-gnu-g++-Wl,-O1-o xlib xlib.o-L/usr/lib/x86_64-linux-gnu/-lXext-lX11-lm
//x-tools/x86_64-unknown-linux-gnu/lib/gcc/x86_64-unknown-linux-gnu/4.3.6/../../../../../../../x86_64-unknown-linux-gnu/bin/ld:警告:libxcb.so.1,未找到/usr/lib/x86_64-linux-gnu//libX11.so所需(尝试使用-rpath或-rpath链接)
当然,这样做是因为交叉编译器中没有libxext

我的问题是:我在这里进行交叉编译,当qt构建的结果注定要在完全不同的平台上运行时,如果主机(!)能够编译X11应用程序,为什么qt要执行测试?如何禁用(某些)这些配置测试


(我通过将-embedded X86添加到我的configure调用中,成功绕过了xlib测试,之后qt就可以正常编译了。但是,正如我所需要的-opengl desktop,这不是一个选项,因为它们似乎是互斥选项)

如果您的目标只是交叉编译本身,那么您“只是”需要有适当的qmake-spec。然后像平常一样安装
qmake->make
。很老了,但我把它作为一个起点。这不是一个真正的答案,但你可能想看看他们在ArchLinux上是如何做到的
x86_64-unknown-linux-gnu-g++ -c -pipe -O2 -Wall -W  -I../../../../qt-everywhere-opensource-src-4.8.5/mkspecs/linux-cluster -I../../../../qt-everywhere-opensource-src-4.8.5/config.tests/x11/xlib -I/usr/include -I../../../../qt-everywhere-opensource-src-4.8.5/config.tests/x11/xlib -I. -o xlib.o ../../../../qt-everywhere-opensource-src-4.8.5/config.tests/x11/xlib/xlib.cpp
x86_64-unknown-linux-gnu-g++ -Wl,-O1 -o xlib xlib.o    -L/usr/lib/x86_64-linux-gnu/  -lXext -lX11 -lm
/<home>/x-tools/x86_64-unknown-linux-gnu/lib/gcc/x86_64-unknown-linux-gnu/4.3.6/../../../../x86_64-unknown-linux-gnu/bin/ld: warning: libxcb.so.1, needed by /usr/lib/x86_64-linux-gnu//libX11.so, not found (try using -rpath or -rpath-link)