Unsolved Cross-compiling Qt on the openssl library
-
**I used Qt5.12's src,and I cross-compiling the openssl-1.1.1 got the /lib and /include **
In the Qt-src,i usesudo ./configure -prefix /opt/qt-arm-5.12 -developer-build -opensource -nomake examples -openssl-linked -xplatform linux-arm-gnueabi-g++ -nomake tests -no-opengl -openssl-linked OPENSSL_LIBS='-L/opt/openssl/lib -lssl -lcryto' -L/opt/openssl/lib -I/opt/openssl/include OPENSSL_INCDIR=/opt/openssl/include OPENSSL_LIBDIR=/opt/openssl/lib
and I use type make. but In the qtbase/src/network have the problem.
make[3]: 进入目录“/opt/Qt5.12.3/5.12.3/Src/qtbase/src/network” /opt/gcc-linaro-7.3-eabi/bin/arm-linux-gnueabi-g++ -c -include .pch/Qt5Network -std=c++11 -pipe -DOPENSSL_API_COMPAT=0x10100000L -g -Og -std=c++1z -fvisibility=hidden -fvisibility-inlines-hidden -D_REENTRANT -fno-exceptions -Wall -W -Wvla -Wdate-time -Wshift-overflow=2 -Wduplicated-cond -Wno-stringop-overflow -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -Wno-error=strict-overflow -Wno-error=implicit-fallthrough -fPIC -DQT_NO_USING_NAMESPACE -DQT_NO_FOREACH -DQT_USE_SYSTEM_PROXIES -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_BUILD_NETWORK_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_CORE_LIB -DQT_CORE_LIB -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I. -I../3rdparty/zlib/src -Ikernel -I../../include -I../../include/QtNetwork -I../../include/QtNetwork/5.12.3 -I../../include/QtNetwork/5.12.3/QtNetwork -I../../include/QtCore/5.12.3 -I../../include/QtCore/5.12.3/QtCore -I../../include/QtCore -I.moc -I/opt/openssl/include -I../../mkspecs/linux-arm-gnueabi-g++ -o .obj/qsslsocket_openssl11.o ssl/qsslsocket_openssl11.cpp In file included from ../../include/QtCore/qglobal.h:1:0, from ../corelib/global/qt_pch.h:56: ../../include/QtCore/../../src/corelib/global/qglobal.h:122:49: 错误: static assertion failed: Required feature library for file ../../include/QtCore/../../src/corelib/plugin/qlibrary.h not available. # define Q_STATIC_ASSERT_X(Condition, Message) static_assert(bool(Condition), Message) ^ ../../include/QtCore/../../src/corelib/global/qglobal.h:87:36: 附注: in expansion of macro ‘Q_STATIC_ASSERT_X’ #define QT_REQUIRE_CONFIG(feature) Q_STATIC_ASSERT_X(QT_FEATURE_##feature == 1, "Required feature " #feature " for file " __FILE__ " not available.") ^~~~~~~~~~~~~~~~~ ../../include/QtCore/../../src/corelib/plugin/qlibrary.h:45:1: 附注: in expansion of macro ‘QT_REQUIRE_CONFIG’ QT_REQUIRE_CONFIG(library); ^~~~~~~~~~~~~~~~~ Makefile:35125: recipe for target '.obj/qsslsocket_openssl11.o' failed make[3]: *** [.obj/qsslsocket_openssl11.o] Error 1 make[3]: 离开目录“/opt/Qt5.12.3/5.12.3/Src/qtbase/src/network” Makefile:276: recipe for target 'sub-network-make_first' failed make[2]: *** [sub-network-make_first] Error 2 make[2]: 离开目录“/opt/Qt5.12.3/5.12.3/Src/qtbase/src” Makefile:50: recipe for target 'sub-src-make_first' failed make[1]: *** [sub-src-make_first] Error 2 make[1]: 离开目录“/opt/Qt5.12.3/5.12.3/Src/qtbase” Makefile:85: recipe for target 'module-qtbase-make_first' failed
This confused me for days,Can someone help me?
-
Hi and welcome to devnet,
Did you check the configure summary ?
Does it show that OpenSSL is activated ?
If not, did you check the tests logs related to OpenSSL ?Side question, are going to hack on Qt ? If not, remove the "-developer-build" option. It triggers some flag for Qt development (don't ask me which one, I currently do not remember the details).
-
configure summary show openssl enable.
Qt Network: getifaddrs() ........................... yes IPv6 ifname ............................ yes libproxy ............................... no Linux AF_NETLINK ....................... yes OpenSSL ................................ yes Qt directly linked to OpenSSL ........ yes OpenSSL 1.1 ............................ yes
And I remove the -developer-build , then
./configure -prefix /opt/qt-arm-5.12 -opensource -release -nomake examples -xplatform linux-arm-gnueabi-g++ -nomake tests -no-opengl -openssl-linked OPENSSL_LIBS='-L/opt/openssl/lib -lssl -lcryto'
this show:
Either ensure that llvm-config is in your PATH environment variable, or set LLVM_INSTALL_DIR to the location of your llvm installation. On Linux systems, you may be able to install libclang by installing the libclang-dev or libclang-devel package, depending on your distribution. On macOS, you can use Homebrew's llvm package. On Windows, you must set LLVM_INSTALL_DIR to the installation path. WARNING: Python version 2 (2.7.5 or later) is required to build QtWebEngine. WARNING: gperf is required to build QtWebEngine. WARNING: bison is required to build QtWebEngine. WARNING: flex is required to build QtWebEngine. WARNING: host pkg-config not found WARNING: Thumb instruction set is required to build ffmpeg for QtWebEngine. ERROR: Feature 'openssl-linked' was enabled, but the pre-condition '!features.securetransport && libs.openssl' failed.
-
Did you check the test logs ?
-
@SGaist I check config.log.There are many mistakes.
some like this :> /opt/gcc-linaro-7.3-eabi/bin/arm-linux-gnueabi-g++ -c -std=c++11 -pipe -O2 -march=armv7-a -O2 -march=armv7-a -O2 -w -fPIC -I. -I/opt/openssl/include -I/opt/Qt5.12.3/5.12.3/Src/qtbase/mkspecs/linux-arm-gnueabi-g++ -o main.o main.cpp > /opt/gcc-linaro-7.3-eabi/bin/arm-linux-gnueabi-g++ -Wl,-O1 -fuse-ld=gold -o libdl main.o -L/opt/openssl/lib > main.o:main.cpp:function main: 错误: 对‘dlopen’未定义的引用 > main.o:main.cpp:function main: 错误: 对‘dlclose’未定义的引用 > main.o:main.cpp:function main: 错误: 对‘dlsym’未定义的引用 > main.o:main.cpp:function main: 错误: 对‘dlerror’未定义的引用 > collect2: 错误: ld 返回 1 > Makefile:67: recipe for target 'libdl' failed
and
> /opt/gcc-linaro-7.3-eabi/bin/arm-linux-gnueabi-g++ -c -std=c++11 -pipe -O2 -march=armv7-a -O2 -march=armv7-a -O2 -w -fPIC -I. -I/opt/openssl/include -I/opt/Qt5.12.3/5.12.3/Src/qtbase/mkspecs/linux-arm-gnueabi-g++ -o main.o main.cpp > main.cpp: 在函数‘int main(int, char**)’中: > main.cpp:9:53: 错误: ‘RENAME_NOREPLACE’在此作用域中尚未声明 > renameat2(AT_FDCWD, argv[1], AT_FDCWD, argv[2], RENAME_NOREPLACE | RENAME_WHITEOUT); > ^~~~~~~~~~~~~~~~ > main.cpp:9:53: 附注: suggested alternative: ‘_IOS_NOREPLACE’ > renameat2(AT_FDCWD, argv[1], AT_FDCWD, argv[2], RENAME_NOREPLACE | RENAME_WHITEOUT); > ^~~~~~~~~~~~~~~~ > _IOS_NOREPLACE > main.cpp:9:72: 错误: ‘RENAME_WHITEOUT’在此作用域中尚未声明 > renameat2(AT_FDCWD, argv[1], AT_FDCWD, argv[2], RENAME_NOREPLACE | RENAME_WHITEOUT); > ^~~~~~~~~~~~~~~ > main.cpp:9:5: 错误: ‘renameat2’在此作用域中尚未声明 > renameat2(AT_FDCWD, argv[1], AT_FDCWD, argv[2], RENAME_NOREPLACE | RENAME_WHITEOUT); > ^~~~~~~~~ > main.cpp:9:5: 附注: suggested alternative: ‘renameat’ > renameat2(AT_FDCWD, argv[1], AT_FDCWD, argv[2], RENAME_NOREPLACE | RENAME_WHITEOUT); > ^~~~~~~~~ > renameat > Makefile:413: recipe for target 'main.o' failed > make: *** [main.o] Error 1
and
> /opt/gcc-linaro-7.3-eabi/bin/arm-linux-gnueabi-g++ -c -std=c++11 -pipe -O2 -march=armv7-a -O2 -march=armv7-a -O2 -w -fPIC -I. -I/opt/openssl/include -I/opt/Qt5.12.3/5.12.3/Src/qtbase/mkspecs/linux-arm-gnueabi-g++ -o main.o main.cpp > main.cpp: 在函数‘int main(int, char**)’中: > main.cpp:11:18: 错误: 聚合‘main(int, char**)::statx statxbuf’类型不完全,无法被定义 > struct statx statxbuf; > ^~~~~~~~ > main.cpp:12:25: 错误: ‘STATX_BASIC_STATS’在此作用域中尚未声明 > unsigned int mask = STATX_BASIC_STATS; > ^~~~~~~~~~~~~~~~~ > main.cpp:13:32: 错误: ‘AT_STATX_SYNC_AS_STAT’在此作用域中尚未声明 > return statx(AT_FDCWD, "", AT_STATX_SYNC_AS_STAT, mask, &statxbuf); > ^~~~~~~~~~~~~~~~~~~~~ > main.cpp:13:70: 错误: 对不完全的类型‘struct main(int, char**)::statx’的非法使用 > return statx(AT_FDCWD, "", AT_STATX_SYNC_AS_STAT, mask, &statxbuf); > ^ > main.cpp:11:12: 附注: forward declaration of ‘struct main(int, char**)::statx’ > struct statx statxbuf; > ^~~~~ > Makefile:413: recipe for target 'main.o' failed > make: *** [main.o] Error 1
-
Please concentrate on the OpenSSL part. It's normal for some tests to fail. For example if you do not have the dependencies required for the MySQL driver, it will correctly fail.