compile qt project error
-
/usr/local/Qt5.9.2/include/QtCore/qtypeinfo.h:67:26: error: invalid application of ‘sizeof’ to incomplete type ‘QSslError’
isLarge = (sizeof(T)>sizeof(void*)),It's seems qt's error. I add 'config+= c++11' to .pro, but it doesn't work.
-
@chris_rookie How was this Qt installed?
-
@chris_rookie You should check the configure log to see whether network modules and SSL were activated.
-
Trying source 0 (type makeSpec) of library network ...
=> source accepted.
executing config test getaddrinfo- cd /home/huayu/qt-everywhere-opensource-src-5.9.2/config.tests/getaddrinfo && /home/huayu/qt-everywhere-opensource-src-5.9.2/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += static use_gold_linker warn_off console single_arch" /home/huayu/qt-everywhere-opensource-src-5.9.2/config.tests/getaddrinfo
- cd /home/huayu/qt-everywhere-opensource-src-5.9.2/config.tests/getaddrinfo && MAKEFLAGS= /usr/bin/make
g++ -c -pipe -O2 -std=gnu++11 -w -fPIC -I. -I/home/huayu/qt-everywhere-opensource-src-5.9.2/qtbase/mkspecs/linux-g++ -o main.o main.cpp
g++ -Wl,-O1 -fuse-ld=gold -o getaddrinfo main.o
test config.network.tests.getaddrinfo succeeded
executing config test getifaddrs- cd /home/huayu/qt-everywhere-opensource-src-5.9.2/config.tests/getifaddrs && /home/huayu/qt-everywhere-opensource-src-5.9.2/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += static use_gold_linker warn_off console single_arch" /home/huayu/qt-everywhere-opensource-src-5.9.2/config.tests/getifaddrs
- cd /home/huayu/qt-everywhere-opensource-src-5.9.2/config.tests/getifaddrs && MAKEFLAGS= /usr/bin/make
g++ -c -pipe -O2 -std=gnu++11 -w -fPIC -I. -I/home/huayu/qt-everywhere-opensource-src-5.9.2/qtbase/mkspecs/linux-g++ -o main.o main.cpp
g++ -Wl,-O1 -fuse-ld=gold -o getifaddrs main.o
test config.network.tests.getifaddrs succeeded
executing config test ipv6ifname- cd /home/huayu/qt-everywhere-opensource-src-5.9.2/config.tests/ipv6ifname && /home/huayu/qt-everywhere-opensource-src-5.9.2/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += static use_gold_linker warn_off console single_arch" /home/huayu/qt-everywhere-opensource-src-5.9.2/config.tests/ipv6ifname
- cd /home/huayu/qt-everywhere-opensource-src-5.9.2/config.tests/ipv6ifname && MAKEFLAGS= /usr/bin/make
g++ -c -pipe -O2 -std=gnu++11 -w -fPIC -I. -I/home/huayu/qt-everywhere-opensource-src-5.9.2/qtbase/mkspecs/linux-g++ -o main.o main.cpp
g++ -Wl,-O1 -fuse-ld=gold -o ipv6ifname main.o
test config.network.tests.ipv6ifname succeeded
looking for library openssl_headers
Trying source 0 (type inline) of library openssl_headers ...- cd /home/huayu/qt-everywhere-opensource-src-5.9.2/config.tests/openssl && /home/huayu/qt-everywhere-opensource-src-5.9.2/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += static use_gold_linker warn_off console single_arch" /home/huayu/qt-everywhere-opensource-src-5.9.2/qtbase/config.tests/openssl
- cd /home/huayu/qt-everywhere-opensource-src-5.9.2/config.tests/openssl && MAKEFLAGS= /usr/bin/make
g++ -c -pipe -O2 -std=gnu++11 -w -fPIC -I/home/huayu/qt-everywhere-opensource-src-5.9.2/qtbase/config.tests/openssl -I. -I/home/huayu/qt-everywhere-opensource-src-5.9.2/qtbase/mkspecs/linux-g++ -o openssl.o /home/huayu/qt-everywhere-opensource-src-5.9.2/qtbase/config.tests/openssl/openssl.cpp
> /home/huayu/qt-everywhere-opensource-src-5.9.2/qtbase/config.tests/openssl/openssl.cpp:40:30: fatal error: openssl/opensslv.h: No such file or directory
compilation terminated.I don't know what caused this faild. And, What should I do?
-
Hi,
Looks like you didn't install the OpenSSL development package.
-
@chris_rookie said in compile qt project error:
atal error: openssl/opensslv.h: No such file or directory
compilation terminated.This is the answer. Looks like OpenSSL dev package is not installed (it contains that header file).
-
@jsulm
Thank you so much.
After Installing OpenSSL development package, should I install Qt again?
.....make[6]: Leaving directory '/home/wuyin/qt-everywhere-opensource-src-5.9.2/qttools/src/designer/src/components/lib'
make[5]: Leaving directory '/home/wuyin/qt-everywhere-opensource-src-5.9.2/qttools/src/designer/src/components'
cd designer/ && ( test -e Makefile || /home/wuyin/qt-everywhere-opensource-src-5.9.2/qtbase/bin/qmake -o Makefile /home/wuyin/qt-everywhere-opensource-src-5.9.2/qttools/src/designer/src/designer/designer.pro ) && make -f Makefile install
make[5]: Entering directory '/home/wuyin/qt-everywhere-opensource-src-5.9.2/qttools/src/designer/src/designer'
make[5]: *** No rule to make target 'install'。 停止。
make[5]: Leaving directory '/home/wuyin/qt-everywhere-opensource-src-5.9.2/qttools/src/designer/src/designer'
Makefile:160: recipe for target 'sub-designer-install_subtargets' failed
make[4]: *** [sub-designer-install_subtargets] Error 2
make[4]: Leaving directory '/home/wuyin/qt-everywhere-opensource-src-5.9.2/qttools/src/designer/src'
Makefile:56: recipe for target 'sub-src-install_subtargets' failed
make[3]: *** [sub-src-install_subtargets] Error 2
make[3]: Leaving directory '/home/wuyin/qt-everywhere-opensource-src-5.9.2/qttools/src/designer'
Makefile:115: recipe for target 'sub-designer-install_subtargets' failed
make[2]: *** [sub-designer-install_subtargets] Error 2
make[2]: Leaving directory '/home/wuyin/qt-everywhere-opensource-src-5.9.2/qttools/src'
Makefile:58: recipe for target 'sub-src-install_subtargets' failed
make[1]: *** [sub-src-install_subtargets] Error 2
make[1]: Leaving directory '/home/wuyin/qt-everywhere-opensource-src-5.9.2/qttools'
Makefile:665: recipe for target 'module-qttools-install_subtargets' failed
make: *** [module-qttools-install_subtargets] Error 2This error occurred during my installation.
What make this faild? -
@chris_rookie said in compile qt project error:
What make this faild?
You should do a clean Qt rebuild without old build artefacts.
-
Can you help me on how you have installed the OpenSSL development package?
I already have installed in my desktop still i am getting error :
/home/huayu/qt-everywhere-opensource-src-5.9.2/qtbase/config.tests/openssl/openssl.cpp:40:30: fatal error: openssl/opensslv.h: No such file or directory
compilation terminated.Thank you,
Jignesh Patel -
@Jignesh-Patel hi,
Which version of OpenSSL did you install ?
Did you install the development package ? -
@SGaist ,
Thank you for reply,
I have installed openssl "OpenSSL 1.1.0f 25 May 2017" on ubuntu 16.04 LTS and also libssl-dev revision is 1.0.2g-1ubuntu4.20.
I am trying to cross compile qt 5.7.1 using following configuration:
"./configure -v -opensource -confirm-license -no-pch -no-xcb -no-opengl -openssl -make libs -device imx6 -compile-examples -device-option CROSS_COMPILE=/home/jignesh/var_mx6ul_dart_debian_stretch93/toolchain/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- -sysroot <rootfs> -no-gcc-sysroot -prefix <installdir>"Best Regards,
Jignesh Patel -
Then that's the issue, the Qt version you want to use is too old to support OpenSSL 1.1. Either update it or install OpenSSL 1.0. There was a huge incompatible jump between the 1.0 and 1.1 versions.
-
@SGaist said in compile qt project error:
OpenSSL 1.0
Thank you for your support.I have installed OpenSSL version "OpenSSL 1.0.2g 1 Mar 2016" but getting same error.
I have some questions about this:- As I am cross-compiling qt in my ubuntu-desktop, does it need to cross-compile openssl before cross compiling qt.
- Does it required to add the path of OpenSSL in the ./config command line argument?
Best Regards,
Jignesh Patel -
You need all dependencies of the right architecture when cross-compiling.
Depending on the distribution you use on your target, you can install the required development packages and sync them back to your main machine as sysroot to use when cross-compiling.
-
@SGaist
Thank you for your reply.Successfully cross-compiled source of 5.7.1:
the issue has been resolved by adding the following:
After downloading the source and compiling OpenSSL 1.0.2 stable../config --prefix=/opt/openssl_build_stable -shared make make test sudo make install
Link open ssl in qt config:
-openssl -I /opt/openssl_build_stable/include -L /opt/openssl_build_stable/lib
Best Regards,
Jignesh Patel