使用MXE交叉编译KDSoap

时间:2015-10-16 14:39:02

标签: qt mingw cross-compiling mxe

在Ubuntu 15.04的MXE中交叉编译qt5 for Windows:

make qt5

然后克隆KDSoap存储库并尝试交叉编译它:

cmake -DCMAKE_TOOLCHAIN_FILE=/data/hd1/repositories/mxe/usr/i686-w64-mingw32.static/share/cmake/mxe-conf.cmake /data/hd1/repositories/KDSoap

然后在make之后出现链接器问题:

/data/hd1/repositories/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Core.a(qregularexpression.o):qregularexpression.cpp:(.text+0x317): undefined reference to `pcre16_exec'
/data/hd1/repositories/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Core.a(qregularexpression.o):qregularexpression.cpp:(.text+0x38f): undefined reference to `pcre16_jit_stack_alloc'
/data/hd1/repositories/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Core.a(qregularexpression.o):qregularexpression.cpp:(.text+0x3fc): undefined reference to `pcre16_exec'
/data/hd1/repositories/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Core.a(qregularexpression.o):qregularexpression.cpp:(.text+0x72e): undefined reference to `pcre16_free'
...
/data/hd1/repositories/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Core.a(qbytearray.o):qbytearray.cpp:(.text+0x619): undefined reference to `uncompress'
/data/hd1/repositories/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Core.a(qbytearray.o):qbytearray.cpp:(.text+0x127e): undefined reference to `compress2'
...
/data/hd1/repositories/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Core.a(qeventdispatcher_win.o):qeventdispatcher_win.cpp:(.text+0xa9b): undefined reference to `_imp__WSAAsyncSelect@16'
/data/hd1/repositories/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Core.a(qeventdispatcher_win.o):qeventdispatcher_win.cpp:(.text+0x1d85): undefined reference to `_imp__WSAAsyncSelect@16'
...
/data/hd1/repositories/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Network.a(qsslsocket_openssl_symbols.o):qsslsocket_openssl_symbols.cpp:(.text+0x1): undefined reference to `ASN1_INTEGER_get'
/data/hd1/repositories/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Network.a(qsslsocket_openssl_symbols.o):qsslsocket_openssl_symbols.cpp:(.text+0x11): undefined reference to `ASN1_STRING_data'
...
/data/hd1/repositories/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Network.a(qsslsocket_openssl_symbols.o):qsslsocket_openssl_symbols.cpp:(.text+0x41): undefined reference to `BIO_ctrl'
/data/hd1/repositories/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Network.a(qsslsocket_openssl_symbols.o):qsslsocket_openssl_symbols.cpp:(.text+0x51): undefined reference to `BIO_free'
/data/hd1/repositories/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Network.a(qsslsocket_openssl_symbols.o):qsslsocket_openssl_symbols.cpp:(.text+0x61): undefined reference to `BIO_new'
...
/data/hd1/repositories/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Network.a(qsslsocket_openssl_symbols.o):qsslsocket_openssl_symbols.cpp:(.text+0xe1): undefined reference to `CRYPTO_num_locks'
/data/hd1/repositories/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Network.a(qsslsocket_openssl_symbols.o):qsslsocket_openssl_symbols.cpp:(.text+0xf1): undefined reference to `CRYPTO_set_locking_callback'
...
/data/hd1/repositories/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Network.a(qsslsocket_openssl_symbols.o):qsslsocket_openssl_symbols.cpp:(.text+0x151): undefined reference to `ERR_error_string'
/data/hd1/repositories/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Network.a(qsslsocket_openssl_symbols.o):qsslsocket_openssl_symbols.cpp:(.text+0x161): undefined reference to `ERR_get_error'
/data/hd1/repositories/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Network.a(qsslsocket_openssl_symbols.o):qsslsocket_openssl_symbols.cpp:(.text+0x171): undefined reference to `ERR_free_strings'
/data/hd1/repositories/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Network.a(qsslsocket_openssl_symbols.o):qsslsocket_openssl_symbols.cpp:(.text+0x181): undefined reference to `EVP_des_ede3_cbc'
...
/data/hd1/repositories/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Network.a(qsslsocket_openssl_symbols.o):qsslsocket_openssl_symbols.cpp:(.text+0x411): undefined reference to `SSL_accept'
/data/hd1/repositories/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Network.a(qsslsocket_openssl_symbols.o):qsslsocket_openssl_symbols.cpp:(.text+0x421): undefined reference to `SSL_clear'
/data/hd1/repositories/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Network.a(qsslsocket_openssl_symbols.o):qsslsocket_openssl_symbols.cpp:(.text+0x431): undefined reference to `SSL_CIPHER_description'
/data/hd1/repositories/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Network.a(qsslsocket_openssl_symbols.o):qsslsocket_openssl_symbols.cpp:(.text+0x441): undefined reference to `SSL_CIPHER_get_bits'
...
/data/hd1/repositories/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Network.a(qnativesocketengine_win.o):qnativesocketengine_win.cpp:(.text+0x1ef): undefined reference to `_imp__WSAHtons@12'
/data/hd1/repositories/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Network.a(qnativesocketengine_win.o):qnativesocketengine_win.cpp:(.text+0x211): undefined reference to `_imp__WSAHtonl@12'
/data/hd1/repositories/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Network.a(qnativesocketengine_win.o):qnativesocketengine_win.cpp:(.text+0x2cf): undefined reference to `_imp__WSAHtons@12'
/data/hd1/repositories/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Network.a(qnativesocketengine_win.o):qnativesocketengine_win.cpp:(.text+0x370): undefined reference to `_imp__WSAStartup@8'
...
/data/hd1/repositories/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Network.a(qspdyprotocolhandler.o):qspdyprotocolhandler.cpp:(.text+0x369): undefined reference to `inflateInit_'
/data/hd1/repositories/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Network.a(qspdyprotocolhandler.o):qspdyprotocolhandler.cpp:(.text+0x39e): undefined reference to `deflateInit_'
/data/hd1/repositories/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Network.a(qspdyprotocolhandler.o):qspdyprotocolhandler.cpp:(.text+0x425): undefined reference to `inflate'
/data/hd1/repositories/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Network.a(qspdyprotocolhandler.o):qspdyprotocolhandler.cpp:(.text+0x665): undefined reference to `inflateSetDictionary'
/data/hd1/repositories/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Network.a(qspdyprotocolhandler.o):qspdyprotocolhandler.cpp:(.text+0xdaa): undefined reference to `deflateEnd'
/data/hd1/repositories/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Network.a(qspdyprotocolhandler.o):qspdyprotocolhandler.cpp:(.text+0xdb8): undefined reference to `deflateEnd'
/data/hd1/repositories/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Network.a(qspdyprotocolhandler.o):qspdyprotocolhandler.cpp:(.text+0x1ac3): undefined reference to `deflate'

这些来自pcrecryptoopensslzlib等等。

我尝试在-lpcre链接器命令中添加CMakeFiles/kdsoap.dir/linklibs.rsp。并手动重新运行链接(例如,在src/KDSoapClient中):

/data/hd1/repositories/mxe/usr/bin/i686-w64-mingw32.static-g++   -O3 -DNDEBUG  -shared -o ../../bin/libkdsoap.dll -Wl,--out-implib,../../lib/libkdsoap.dll.a -Wl,--major-image-version,1,--minor-image-version,4 -Wl,--whole-archive CMakeFiles/kdsoap.dir/objects.a -Wl,--no-whole-archive @CMakeFiles/kdsoap.dir/linklibs.rsp

pcre相关的链接错误并没有消失。

可以采取哪些措施进行更多调查?或者有一个不同的程序来交叉编译基于Qt的代码?

2 个答案:

答案 0 :(得分:0)

尝试将<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="horizontal" > <TextView android:id="@+id/spinnerItemIdTv" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#888" android:textSize="20sp" android:visibility="gone"/> <TextView android:id="@+id/spinnerItemNameTv" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#888" android:textSize="20sp" /> </LinearLayout> 添加到链接器命令。

答案 1 :(得分:0)

obj

对我有用
CMakeLists.txt