Unsolved Why Qt creator say "use of undeclared identifier 'QSslSocket'", but it exists.
-
@SGaist
according to Qt doc:#!/bin/sh export HOST=linux-x86_64 export PATH="$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/$HOST/bin":$PATH cd /home/sen/github/c/openssl-1.1.1g ./Configure shared android-arm -D__ANDROID_API__=21 make -j12 SHLIB_VERSION_NUMBER= SHLIB_EXT=_1_1.so build_libs
-
Then why are you mixing your system installation with your custom OpenSSL build.
By the way, your Intel CET is likely due to a line that starts with a #. My guess is that this is a comme but Python style rather than C/C++ style.
-
@SGaist The config.log above is the log of build qt-opensource, not openssl.Myself OpenSSL build is arm binding.
-
Can you provide the complete OpenSSL checks part ?
-
@SGaist Do you mean "make check"? In order to check whether the two files libssl_1_1_1.so and libcrypto_1_1_1.so can be used? These two files can be correctly linked to the android project and using , should be no problem.
-
@senmx said in Why Qt creator say "use of undeclared identifier 'QSslSocket'", but it exists.:
Do you mean "make check"?
No, the SSL check in config.log which is:
loaded result for library config.qtbase_network.libraries.openssl Trying source 0 (type openssl) of library openssl ... + cd /home/sen/soft/qt-everywhere-src-5.15.1/config.tests/openssl && /home/sen/soft/qt-everywhere-src-5.15.1/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" -early "CONFIG += cross_compile" 'QMAKE_USE += openssl' 'QMAKE_LIBS_OPENSSL = -L/home/sen/github/c/openssl-1.1.1g -lssl -lcrypto' /home/sen/soft/qt-everywhere-src-5.15.1/config.tests/openssl + cd /home/sen/soft/qt-everywhere-src-5.15.1/config.tests/openssl && MAKEFLAGS= /usr/bin/make > /opt/android-sdk/ndk/21.1.6352462/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -c -target aarch64-linux-android21 -fno-limit-debug-info -fPIC -fstack-protector-strong -DANDROID -O2 -fPIC -I. -I/home/sen/soft/qt-everywhere-src-5.15.1/qtbase/mkspecs/android-clang -o main.o main.cpp > main.cpp:2:10: fatal error: 'openssl/ssl.h' file not found > #include <openssl/ssl.h> > ^~~~~~~~~~~~~~~ > 1 error generated.
-
From the looks of it, you did not provide the correct path to the where the includes are located.
-
@SGaist Thanks, If this is the case, how to solve it? There are other header files that can't be found. The header file of openssl is under /usr/include.
OPENSSL_LIBS='-L/home/sen/github/c/openssl-1.1.1g -lssl -lcrypto' ./configure -xplatform android-clang -prefix /usr/local/Qt-5.15.1-android --disable-rpath -nomake tests -nomake examples -android-ndk $ANDROID_NDK_HOME -android-sdk $AND ROID_SDK_HOME -no-warnings-are-errors -openssl-linked
-
The headers in /usr/includes are usually the ones installed by official packages. Where are the ones from the version you built ?
-
-
-headerdir is for where the headers will be installed.
Use the -I parameter to add other paths to look for headers.
-
@SGaist Well, I have tried all these parameters, it is probably a bug, because I saw the same problem in the bug feedback area. I am using the lower version now, the installation version.