qt应用程序编译时的问题
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了qt应用程序编译时的问题相关的知识,希望对你有一定的参考价值。
小弟在编译其他程序时出现如下问题,请高手赐教:
#include<qapplication.h>
#include<qpushbutton.h>
int main(int argc,char **argv)
QApplication app(argc,argv);
QPushButton hello("Hello,World!",0);
hello.resize(100,30);
app.SetMainWidget(&hello);
hello.show();
return app.exec();
编译时出错:
hello.cpp: In function `int main(int, char**)':
hello.cpp:8: no matching function for call to `QApplication::SetMainWidget(QPushButton*)'
多谢多谢
2、如果arm上没有qt库,不能运行QT程序,必须把相应的QT库按装到ARM板上。
3、qmake产生makefile,make根据makefile调用gcc进行编译。
4、qt-embedded-linux-opensource-src-4.4.3.tar.gz是用在嵌入式上的QT开发库。用法与qt-4.4.3-x11版的用法一样。
5、没有办法仿真,只能先进行qt-embedded的移植工作。但是开发qt-embedded程序时,到是可以在PC机上先用qvfb仿真调试的。
6、qt-embedded库先交叉编译,完成后下载到开发板上,以后开发应用程序时,qt库不用再下载的。
7、写qt程序需要4.0版以上的交叉编译器。网上可以下载现成。
8、这是三个不同版本的gcc交叉编译器,都老了。目前至少应该使用gcc 4.0以上的。
9、肯定是不行的。
10、呵呵,我也是从新手过来的。也问过类似的小白问题。
另外,团IDC网上有许多产品团购,便宜有口碑 参考技术A qpushbuttion不能作为widget使用
需要自己建立一个QWidget,然后将QPushButton放上去,然后,show QWidget就可以了追问
感谢,感谢!能告诉我具体步骤吗?我的程序是从书上抄的。而且是刚刚使用QT,是在linux上搭建的平台。不太明白其中奥妙。望多加指点!
参考技术B 我对QT不太熟悉hello.show()是不是该改为app.show()
我记得QT好像用树形结构渲染窗口的,app本身是一个默认隐藏的根窗口
hello是app上的子窗口
使用交叉编译构建 QT 5.15.2(w/QTWebEngine)时的问题
【中文标题】使用交叉编译构建 QT 5.15.2(w/QTWebEngine)时的问题【英文标题】:Issue when building QT 5.15.2 (w/ QTWebEngine) with cross compile 【发布时间】:2020-12-08 18:05:02 【问题描述】:在过去的几周里,我花费了大量的精力来尝试简化和精简 Raspberry Pi 的 QT 构建,并且我非常接近了终点。
简而言之,我已经 dockerized 和 scripted 完成了整个构建过程,以确保我们能够以简单且可重复的方式为 Pi 1 - Pi 4 构建映像,而无需物理 Raspberry Pi。
作为 QT 的 ./configure
步骤的一部分,我已经能够检测到 Pi 3 和 Pi 4 的硬件加速,并且能够很好地构建 QT Base(和其他一些依赖项)。但是,作为错误的一部分,我对最后一个错误失去了理智。
该错误非常类似于 Enrico Zini 所描述的 here,但他的解决方法 dpkg --purge libraspberrypi-dev
(或者更确切地说是 Andreas Gruber's)不会解决它,因为它会禁用硬件加速,我需要。
错误出现在QTWebEngine构建的后期:
[...]
[20312/20662] ccache /src/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -MMD -MF obj/QtWebEngineCore/gl_surface_qt.o.d -DCHROMIUM_VERSION=\"83.0.4103.122\" -DUSE_UDEV -DUSE_AURA=1 -DUSE_NSS_CERTS=1 -DUSE_OZONE=1 -DOFFICIAL_BUILD -DTOOLKIT_QT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DCR_SYSROOT_HASH=3fcc1d4e44127006318371002a0f421a4fde2ab4 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DQT_NO_LINKED_LIST -DQT_NO_KEYWORDS -DQT_USE_QSTRINGBUILDER -DQ_FORWARD_DECLARE_OBJC_CLASS=QT_FORWARD_DECLARE_CLASS -DQTWEBENGINECORE_VERSION_STR=\"5.15.2\" -DQTWEBENGINEPROCESS_NAME=\"QtWebEngineProcess\" -DBUILDING_CHROMIUM -DQTWEBENGINE_EMBEDDED_SWITCHES -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QMLMODELS_LIB -DQT_WEBCHANNEL_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_WEBENGINECOREHEADERS_LIB -DVK_NO_PROTOTYPES -DUSE_EGL -DU_USING_ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD=0 -DUSE_CHROMIUM_ICU=1 -DU_ENABLE_TRACING=1 -DU_ENABLE_RESOURCE_TRACING=0 -DU_STATIC_IMPLEMENTATION -DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE -DUCHAR_TYPE=uint16_t -DGOOGLE_PROTOBUF_NO_RTTI -DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER -DHAVE_PTHREAD -DWEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=0 -DWEBRTC_CHROMIUM_BUILD -DWEBRTC_POSIX -DWEBRTC_LINUX -DABSL_ALLOCATOR_NOTHROW=1 -DWEBRTC_USE_BUILTIN_ISAC_FIX=1 -DWEBRTC_USE_BUILTIN_ISAC_FLOAT=0 -DHAVE_SCTP -DNO_MAIN_THREAD_WRAPPING -DSK_CODEC_DECODES_PNG -DSK_CODEC_DECODES_WEBP -DSK_ENCODE_PNG -DSK_ENCODE_WEBP -DSK_USER_CONFIG_HEADER=\"../../skia/config/SkUserConfig.h\" -DSK_GL -DSK_CODEC_DECODES_JPEG -DSK_ENCODE_JPEG -DSK_USE_LIBGIFCODEC -DSK_VULKAN_HEADER=\"../../skia/config/SkVulkanConfig.h\" -DSK_VULKAN=1 -DSK_SUPPORT_GPU=1 -DSK_GPU_WORKAROUNDS_HEADER=\"gpu/config/gpu_driver_bug_workaround_autogen.h\" -DVK_NO_PROTOTYPES -DCRASHPAD_ZLIB_SOURCE_EXTERNAL -DUSE_SYSTEM_ZLIB=1 -DLEVELDB_PLATFORM_CHROMIUM=1 -DLEVELDB_PLATFORM_CHROMIUM=1 -DV8_DEPRECATION_WARNINGS -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/skia/config -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/include -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/skia/include/core -Igen -I../../../../../qt5/qtwebengine/src/3rdparty/chromium -I/src/qt5/qtwebengine/src/core -I/src/qt5/qtwebengine/src/core/api -I/src/qt5/qtdeclarative/include/QtQuick/5.15.2 -I/src/qt5/qtdeclarative/include/QtQuick/5.15.2/QtQuick -I/src/pi3/qtdeclarative/include/QtQuick/5.15.2 -I/src/pi3/qtdeclarative/include/QtQuick/5.15.2/QtQuick -I/src/qt5/qtbase/include/QtGui/5.15.2 -I/src/qt5/qtbase/include/QtGui/5.15.2/QtGui -I/src/pi3/qtbase/include/QtGui/5.15.2 -I/src/pi3/qtbase/include/QtGui/5.15.2/QtGui -I/src/qt5/qtdeclarative/include -I/src/qt5/qtdeclarative/include/QtQuick -I/src/pi3/qtdeclarative/include -I/src/pi3/qtdeclarative/include/QtQuick -I/src/qt5/qtbase/include -I/src/qt5/qtbase/include/QtGui -I/src/pi3/qtbase/include -I/src/pi3/qtbase/include/QtGui -I/src/qt5/qtdeclarative/include/QtQmlModels/5.15.2 -I/src/qt5/qtdeclarative/include/QtQmlModels/5.15.2/QtQmlModels -I/src/pi3/qtdeclarative/include/QtQmlModels/5.15.2 -I/src/pi3/qtdeclarative/include/QtQmlModels/5.15.2/QtQmlModels -I/src/qt5/qtdeclarative/include/QtQml/5.15.2 -I/src/qt5/qtdeclarative/include/QtQml/5.15.2/QtQml -I/src/pi3/qtdeclarative/include/QtQml/5.15.2 -I/src/pi3/qtdeclarative/include/QtQml/5.15.2/QtQml -I/src/qt5/qtbase/include/QtCore/5.15.2 -I/src/qt5/qtbase/include/QtCore/5.15.2/QtCore -I/src/pi3/qtbase/include/QtCore/5.15.2 -I/src/pi3/qtbase/include/QtCore/5.15.2/QtCore -I/src/qt5/qtdeclarative/include/QtQmlModels -I/src/pi3/qtdeclarative/include/QtQmlModels -I/src/qt5/qtwebchannel/include -I/src/qt5/qtwebchannel/include/QtWebChannel -I/src/pi3/qtwebchannel/include -I/src/pi3/qtwebchannel/include/QtWebChannel -I/src/qt5/qtdeclarative/include/QtQml -I/src/pi3/qtdeclarative/include/QtQml -I/src/qt5/qtbase/include/QtNetwork -I/src/pi3/qtbase/include/QtNetwork -I/src/qt5/qtbase/include/QtCore -I/src/pi3/qtbase/include/QtCore -I/src/qt5/qtwebengine/include -I/src/qt5/qtwebengine/include/QtWebEngineCore -I/src/qt5/qtwebengine/include/QtWebEngineCore/5.15.2 -I/src/qt5/qtwebengine/include/QtWebEngineCore/5.15.2/QtWebEngineCore -I/src/pi3/qtwebengine/include -I/src/pi3/qtwebengine/include/QtWebEngineCore -I/src/pi3/qtwebengine/include/QtWebEngineCore/5.15.2 -I/src/pi3/qtwebengine/include/QtWebEngineCore/5.15.2/QtWebEngineCore -I.moc -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -Igen/.moc -I/src/qt5/qtbase/mkspecs/devices/linux-rasp-pi3-g++ -Igen -Igen -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/perfetto/include -Igen/third_party/perfetto/build_config -Igen/third_party/perfetto -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/libyuv/include -Igen -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/jsoncpp/source/include -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/jsoncpp/generated -Igen -Igen -Igen/third_party/dawn/src/include -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/dawn/src/include -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/khronos -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/gpu -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/vulkan/include -Igen -Igen -Igen -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/include -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/ced/src -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/icu/source/common -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/icu/source/i18n -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/protobuf/src -Igen/protoc_out -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/protobuf/src -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/webrtc_overrides -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/webrtc -Igen/third_party/webrtc -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/skia -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/libgifcodec -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/vulkan/include -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/vulkanmemoryallocator -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/vulkan/include -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/compat/non_mac -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/compat/linux -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/compat/non_win -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/libwebm/source -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/leveldatabase -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/leveldatabase/src -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/leveldatabase/src/include -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/v8/include -Igen/v8/include -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/mesa_headers -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pipe -pthread -march=armv8-a -mfloat-abi=hard -mtune=cortex-a53 -mfpu=neon -mthumb -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wno-psabi -Wno-unused-local-typedefs -Wno-maybe-uninitialized -Wno-deprecated-declarations -fno-delete-null-pointer-checks -Wno-comments -Wno-packed-not-aligned -Wno-dangling-else -Wno-missing-field-initializers -Wno-unused-parameter -O2 -fno-ident -fdata-sections -ffunction-sections -fno-omit-frame-pointer -g0 -fvisibility=hidden -march=armv8-a -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard --sysroot=/sysroot -O2 -fno-exceptions -Wall -Wextra -D_REENTRANT -I/sysroot/usr/include/nss -I/sysroot/usr/include/nspr -std=gnu++14 -Wno-narrowing -Wno-class-memaccess -Wno-attributes -Wno-class-memaccess -Wno-subobject-linkage -Wno-invalid-offsetof -Wno-return-type -Wno-deprecated-copy -fno-exceptions -fno-rtti --sysroot=../../../../../../sysroot -fvisibility-inlines-hidden -march=armv8-a -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard --sysroot=/sysroot -O2 -std=gnu++1y -fno-exceptions -Wall -Wextra -D_REENTRANT -Wno-unused-parameter -Wno-unused-variable -Wno-deprecated-declarations -c /src/qt5/qtwebengine/src/core/ozone/gl_surface_qt.cpp -o obj/QtWebEngineCore/gl_surface_qt.o
FAILED: obj/QtWebEngineCore/gl_surface_qt.o
ccache /src/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -MMD -MF obj/QtWebEngineCore/gl_surface_qt.o.d -DCHROMIUM_VERSION=\"83.0.4103.122\" -DUSE_UDEV -DUSE_AURA=1 -DUSE_NSS_CERTS=1 -DUSE_OZONE=1 -DOFFICIAL_BUILD -DTOOLKIT_QT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DCR_SYSROOT_HASH=3fcc1d4e44127006318371002a0f421a4fde2ab4 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DQT_NO_LINKED_LIST -DQT_NO_KEYWORDS -DQT_USE_QSTRINGBUILDER -DQ_FORWARD_DECLARE_OBJC_CLASS=QT_FORWARD_DECLARE_CLASS -DQTWEBENGINECORE_VERSION_STR=\"5.15.2\" -DQTWEBENGINEPROCESS_NAME=\"QtWebEngineProcess\" -DBUILDING_CHROMIUM -DQTWEBENGINE_EMBEDDED_SWITCHES -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QMLMODELS_LIB -DQT_WEBCHANNEL_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_WEBENGINECOREHEADERS_LIB -DVK_NO_PROTOTYPES -DUSE_EGL -DU_USING_ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD=0 -DUSE_CHROMIUM_ICU=1 -DU_ENABLE_TRACING=1 -DU_ENABLE_RESOURCE_TRACING=0 -DU_STATIC_IMPLEMENTATION -DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE -DUCHAR_TYPE=uint16_t -DGOOGLE_PROTOBUF_NO_RTTI -DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER -DHAVE_PTHREAD -DWEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=0 -DWEBRTC_CHROMIUM_BUILD -DWEBRTC_POSIX -DWEBRTC_LINUX -DABSL_ALLOCATOR_NOTHROW=1 -DWEBRTC_USE_BUILTIN_ISAC_FIX=1 -DWEBRTC_USE_BUILTIN_ISAC_FLOAT=0 -DHAVE_SCTP -DNO_MAIN_THREAD_WRAPPING -DSK_CODEC_DECODES_PNG -DSK_CODEC_DECODES_WEBP -DSK_ENCODE_PNG -DSK_ENCODE_WEBP -DSK_USER_CONFIG_HEADER=\"../../skia/config/SkUserConfig.h\" -DSK_GL -DSK_CODEC_DECODES_JPEG -DSK_ENCODE_JPEG -DSK_USE_LIBGIFCODEC -DSK_VULKAN_HEADER=\"../../skia/config/SkVulkanConfig.h\" -DSK_VULKAN=1 -DSK_SUPPORT_GPU=1 -DSK_GPU_WORKAROUNDS_HEADER=\"gpu/config/gpu_driver_bug_workaround_autogen.h\" -DVK_NO_PROTOTYPES -DCRASHPAD_ZLIB_SOURCE_EXTERNAL -DUSE_SYSTEM_ZLIB=1 -DLEVELDB_PLATFORM_CHROMIUM=1 -DLEVELDB_PLATFORM_CHROMIUM=1 -DV8_DEPRECATION_WARNINGS -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/skia/config -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/include -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/skia/include/core -Igen -I../../../../../qt5/qtwebengine/src/3rdparty/chromium -I/src/qt5/qtwebengine/src/core -I/src/qt5/qtwebengine/src/core/api -I/src/qt5/qtdeclarative/include/QtQuick/5.15.2 -I/src/qt5/qtdeclarative/include/QtQuick/5.15.2/QtQuick -I/src/pi3/qtdeclarative/include/QtQuick/5.15.2 -I/src/pi3/qtdeclarative/include/QtQuick/5.15.2/QtQuick -I/src/qt5/qtbase/include/QtGui/5.15.2 -I/src/qt5/qtbase/include/QtGui/5.15.2/QtGui -I/src/pi3/qtbase/include/QtGui/5.15.2 -I/src/pi3/qtbase/include/QtGui/5.15.2/QtGui -I/src/qt5/qtdeclarative/include -I/src/qt5/qtdeclarative/include/QtQuick -I/src/pi3/qtdeclarative/include -I/src/pi3/qtdeclarative/include/QtQuick -I/src/qt5/qtbase/include -I/src/qt5/qtbase/include/QtGui -I/src/pi3/qtbase/include -I/src/pi3/qtbase/include/QtGui -I/src/qt5/qtdeclarative/include/QtQmlModels/5.15.2 -I/src/qt5/qtdeclarative/include/QtQmlModels/5.15.2/QtQmlModels -I/src/pi3/qtdeclarative/include/QtQmlModels/5.15.2 -I/src/pi3/qtdeclarative/include/QtQmlModels/5.15.2/QtQmlModels -I/src/qt5/qtdeclarative/include/QtQml/5.15.2 -I/src/qt5/qtdeclarative/include/QtQml/5.15.2/QtQml -I/src/pi3/qtdeclarative/include/QtQml/5.15.2 -I/src/pi3/qtdeclarative/include/QtQml/5.15.2/QtQml -I/src/qt5/qtbase/include/QtCore/5.15.2 -I/src/qt5/qtbase/include/QtCore/5.15.2/QtCore -I/src/pi3/qtbase/include/QtCore/5.15.2 -I/src/pi3/qtbase/include/QtCore/5.15.2/QtCore -I/src/qt5/qtdeclarative/include/QtQmlModels -I/src/pi3/qtdeclarative/include/QtQmlModels -I/src/qt5/qtwebchannel/include -I/src/qt5/qtwebchannel/include/QtWebChannel -I/src/pi3/qtwebchannel/include -I/src/pi3/qtwebchannel/include/QtWebChannel -I/src/qt5/qtdeclarative/include/QtQml -I/src/pi3/qtdeclarative/include/QtQml -I/src/qt5/qtbase/include/QtNetwork -I/src/pi3/qtbase/include/QtNetwork -I/src/qt5/qtbase/include/QtCore -I/src/pi3/qtbase/include/QtCore -I/src/qt5/qtwebengine/include -I/src/qt5/qtwebengine/include/QtWebEngineCore -I/src/qt5/qtwebengine/include/QtWebEngineCore/5.15.2 -I/src/qt5/qtwebengine/include/QtWebEngineCore/5.15.2/QtWebEngineCore -I/src/pi3/qtwebengine/include -I/src/pi3/qtwebengine/include/QtWebEngineCore -I/src/pi3/qtwebengine/include/QtWebEngineCore/5.15.2 -I/src/pi3/qtwebengine/include/QtWebEngineCore/5.15.2/QtWebEngineCore -I.moc -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -Igen/.moc -I/src/qt5/qtbase/mkspecs/devices/linux-rasp-pi3-g++ -Igen -Igen -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/perfetto/include -Igen/third_party/perfetto/build_config -Igen/third_party/perfetto -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/libyuv/include -Igen -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/jsoncpp/source/include -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/jsoncpp/generated -Igen -Igen -Igen/third_party/dawn/src/include -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/dawn/src/include -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/khronos -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/gpu -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/vulkan/include -Igen -Igen -Igen -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/boringssl/src/include -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/ced/src -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/icu/source/common -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/icu/source/i18n -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/protobuf/src -Igen/protoc_out -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/protobuf/src -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/webrtc_overrides -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/webrtc -Igen/third_party/webrtc -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/abseil-cpp -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/skia -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/libgifcodec -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/vulkan/include -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/skia/third_party/vulkanmemoryallocator -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/vulkan/include -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/compat/non_mac -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/compat/linux -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/crashpad/crashpad/compat/non_win -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/libwebm/source -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/leveldatabase -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/leveldatabase/src -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/leveldatabase/src/include -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/v8/include -Igen/v8/include -I../../../../../qt5/qtwebengine/src/3rdparty/chromium/third_party/mesa_headers -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pipe -pthread -march=armv8-a -mfloat-abi=hard -mtune=cortex-a53 -mfpu=neon -mthumb -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wno-psabi -Wno-unused-local-typedefs -Wno-maybe-uninitialized -Wno-deprecated-declarations -fno-delete-null-pointer-checks -Wno-comments -Wno-packed-not-aligned -Wno-dangling-else -Wno-missing-field-initializers -Wno-unused-parameter -O2 -fno-ident -fdata-sections -ffunction-sections -fno-omit-frame-pointer -g0 -fvisibility=hidden -march=armv8-a -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard --sysroot=/sysroot -O2 -fno-exceptions -Wall -Wextra -D_REENTRANT -I/sysroot/usr/include/nss -I/sysroot/usr/include/nspr -std=gnu++14 -Wno-narrowing -Wno-class-memaccess -Wno-attributes -Wno-class-memaccess -Wno-subobject-linkage -Wno-invalid-offsetof -Wno-return-type -Wno-deprecated-copy -fno-exceptions -fno-rtti --sysroot=../../../../../../sysroot -fvisibility-inlines-hidden -march=armv8-a -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard --sysroot=/sysroot -O2 -std=gnu++1y -fno-exceptions -Wall -Wextra -D_REENTRANT -Wno-unused-parameter -Wno-unused-variable -Wno-deprecated-declarations -c /src/qt5/qtwebengine/src/core/ozone/gl_surface_qt.cpp -o obj/QtWebEngineCore/gl_surface_qt.o
In file included from ../../../../../qt5/qtwebengine/src/3rdparty/chromium/ui/gl/gl_bindings.h:511:0,
from /src/qt5/qtwebengine/src/core/ozone/gl_surface_qt.cpp:57:
../../../../../qt5/qtwebengine/src/3rdparty/chromium/ui/gl/gl_bindings_autogen_egl.h:201:5: error: 'EGLDeviceEXT' has not been declared
EGLDeviceEXT* devices,
^~~~~~~~~~~~
../../../../../qt5/qtwebengine/src/3rdparty/chromium/ui/gl/gl_bindings_autogen_egl.h:204:5: error: typedef 'gl::eglQueryDeviceStringEXTProc' is initialized (use decltype instead)
EGLDeviceEXT device,
^~~~~~~~~~~~
../../../../../qt5/qtwebengine/src/3rdparty/chromium/ui/gl/gl_bindings_autogen_egl.h:204:5: error: 'EGLDeviceEXT' was not declared in this scope
../../../../../qt5/qtwebengine/src/3rdparty/chromium/ui/gl/gl_bindings_autogen_egl.h:205:12: error: expected primary-expression before 'name'
EGLint name);
^~~~
../../../../../qt5/qtwebengine/src/3rdparty/chromium/ui/gl/gl_bindings_autogen_egl.h:239:5: error: 'EGLSetBlobFuncANDROID' has not been declared
EGLSetBlobFuncANDROID set,
^~~~~~~~~~~~~~~~~~~~~
../../../../../qt5/qtwebengine/src/3rdparty/chromium/ui/gl/gl_bindings_autogen_egl.h:240:5: error: 'EGLGetBlobFuncANDROID' has not been declared
EGLGetBlobFuncANDROID get);
^~~~~~~~~~~~~~~~~~~~~
../../../../../qt5/qtwebengine/src/3rdparty/chromium/ui/gl/gl_bindings_autogen_egl.h:371:3: error: 'eglQueryDeviceStringEXTProc' does not name a type; did you mean 'eglQueryDeviceStringEXT'?
eglQueryDeviceStringEXTProc eglQueryDeviceStringEXTFn;
^~~~~~~~~~~~~~~~~~~~~~~~~~~
eglQueryDeviceStringEXT
../../../../../qt5/qtwebengine/src/3rdparty/chromium/ui/gl/gl_bindings_autogen_egl.h:567:43: error: 'EGLDeviceEXT' has not been declared
EGLDeviceEXT* devices,
^~~~~~~~~~~~
../../../../../qt5/qtwebengine/src/3rdparty/chromium/ui/gl/gl_bindings_autogen_egl.h:569:49: error: 'eglQueryDeviceStringEXTFn' declared as a 'virtual' field
virtual const char* eglQueryDeviceStringEXTFn(EGLDeviceEXT device,
^~~~~~~~~~~~
../../../../../qt5/qtwebengine/src/3rdparty/chromium/ui/gl/gl_bindings_autogen_egl.h:569:23: error: expected ';' at end of member declaration
virtual const char* eglQueryDeviceStringEXTFn(EGLDeviceEXT device,
^~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../qt5/qtwebengine/src/3rdparty/chromium/ui/gl/gl_bindings_autogen_egl.h:569:62: error: expected ')' before 'device'
virtual const char* eglQueryDeviceStringEXTFn(EGLDeviceEXT device,
^~~~~~
../../../../../qt5/qtwebengine/src/3rdparty/chromium/ui/gl/gl_bindings_autogen_egl.h:599:46: error: 'EGLSetBlobFuncANDROID' has not been declared
EGLSetBlobFuncANDROID set,
^~~~~~~~~~~~~~~~~~~~~
../../../../../qt5/qtwebengine/src/3rdparty/chromium/ui/gl/gl_bindings_autogen_egl.h:600:46: error: 'EGLGetBlobFuncANDROID' has not been declared
EGLGetBlobFuncANDROID get) = 0;
^~~~~~~~~~~~~~~~~~~~~
In file included from ../../../../../qt5/qtwebengine/src/3rdparty/chromium/ui/gl/gl_egl_api_implementation.h:31:0,
from /src/qt5/qtwebengine/src/core/ozone/gl_surface_qt.cpp:71:
../../../../../qt5/qtwebengine/src/3rdparty/chromium/ui/gl/gl_bindings_api_autogen_egl.h:164:33: error: 'EGLDeviceEXT' has not been declared
EGLDeviceEXT* devices,
^~~~~~~~~~~~
../../../../../qt5/qtwebengine/src/3rdparty/chromium/ui/gl/gl_bindings_api_autogen_egl.h:166:13: error: expected ';' at end of member declaration
const char* eglQueryDeviceStringEXTFn(EGLDeviceEXT device,
^~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../qt5/qtwebengine/src/3rdparty/chromium/ui/gl/gl_bindings_api_autogen_egl.h:166:52: error: expected ')' before 'device'
const char* eglQueryDeviceStringEXTFn(EGLDeviceEXT device,
^~~~~~
../../../../../qt5/qtwebengine/src/3rdparty/chromium/ui/gl/gl_bindings_api_autogen_egl.h:196:36: error: 'EGLSetBlobFuncANDROID' has not been declared
EGLSetBlobFuncANDROID set,
^~~~~~~~~~~~~~~~~~~~~
../../../../../qt5/qtwebengine/src/3rdparty/chromium/ui/gl/gl_bindings_api_autogen_egl.h:197:36: error: 'EGLGetBlobFuncANDROID' has not been declared
EGLGetBlobFuncANDROID get) override;
^~~~~~~~~~~~~~~~~~~~~
In file included from ../../../../../qt5/qtwebengine/src/3rdparty/chromium/ui/gl/gl_egl_api_implementation.h:66:0,
from /src/qt5/qtwebengine/src/core/ozone/gl_surface_qt.cpp:71:
../../../../../qt5/qtwebengine/src/3rdparty/chromium/ui/gl/gl_bindings_api_autogen_egl.h:164:33: error: 'EGLDeviceEXT' has not been declared
EGLDeviceEXT* devices,
^~~~~~~~~~~~
../../../../../qt5/qtwebengine/src/3rdparty/chromium/ui/gl/gl_bindings_api_autogen_egl.h:166:13: error: expected ';' at end of member declaration
const char* eglQueryDeviceStringEXTFn(EGLDeviceEXT device,
^~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../qt5/qtwebengine/src/3rdparty/chromium/ui/gl/gl_bindings_api_autogen_egl.h:166:52: error: expected ')' before 'device'
const char* eglQueryDeviceStringEXTFn(EGLDeviceEXT device,
^~~~~~
../../../../../qt5/qtwebengine/src/3rdparty/chromium/ui/gl/gl_bindings_api_autogen_egl.h:196:36: error: 'EGLSetBlobFuncANDROID' has not been declared
EGLSetBlobFuncANDROID set,
^~~~~~~~~~~~~~~~~~~~~
../../../../../qt5/qtwebengine/src/3rdparty/chromium/ui/gl/gl_bindings_api_autogen_egl.h:197:36: error: 'EGLGetBlobFuncANDROID' has not been declared
EGLGetBlobFuncANDROID get) override;
^~~~~~~~~~~~~~~~~~~~~
In file included from ../../../../../qt5/qtwebengine/src/3rdparty/chromium/ui/gl/gl_egl_api_implementation.h:82:0,
from /src/qt5/qtwebengine/src/core/ozone/gl_surface_qt.cpp:71:
../../../../../qt5/qtwebengine/src/3rdparty/chromium/ui/gl/gl_bindings_api_autogen_egl.h:164:33: error: 'EGLDeviceEXT' has not been declared
EGLDeviceEXT* devices,
^~~~~~~~~~~~
../../../../../qt5/qtwebengine/src/3rdparty/chromium/ui/gl/gl_bindings_api_autogen_egl.h:166:13: error: expected ';' at end of member declaration
const char* eglQueryDeviceStringEXTFn(EGLDeviceEXT device,
^~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../qt5/qtwebengine/src/3rdparty/chromium/ui/gl/gl_bindings_api_autogen_egl.h:166:52: error: expected ')' before 'device'
const char* eglQueryDeviceStringEXTFn(EGLDeviceEXT device,
^~~~~~
../../../../../qt5/qtwebengine/src/3rdparty/chromium/ui/gl/gl_bindings_api_autogen_egl.h:196:36: error: 'EGLSetBlobFuncANDROID' has not been declared
EGLSetBlobFuncANDROID set,
^~~~~~~~~~~~~~~~~~~~~
../../../../../qt5/qtwebengine/src/3rdparty/chromium/ui/gl/gl_bindings_api_autogen_egl.h:197:36: error: 'EGLGetBlobFuncANDROID' has not been declared
EGLGetBlobFuncANDROID get) override;
^~~~~~~~~~~~~~~~~~~~~
cc1plus: warning: unrecognized command line option '-Wno-deprecated-copy'
cc1plus: warning: unrecognized command line option '-Wno-class-memaccess'
cc1plus: warning: unrecognized command line option '-Wno-class-memaccess'
cc1plus: warning: unrecognized command line option '-Wno-packed-not-aligned'
[...]
ninja: build stopped: subcommand failed.
make[4]: *** [Makefile.gn_run:763: run_ninja] Error 1
make[4]: Leaving directory '/src/pi3/qtwebengine/src/core'
make[3]: *** [Makefile:82: sub-gn_run-pro-make_first] Error 2
make[3]: Leaving directory '/src/pi3/qtwebengine/src/core'
make[2]: *** [Makefile:79: sub-core-make_first] Error 2
make[2]: Leaving directory '/src/pi3/qtwebengine/src'
make[1]: *** [Makefile:49: sub-src-make_first] Error 2
make[1]: Leaving directory '/src/pi3/qtwebengine'
make: *** [Makefile:370: module-qtwebengine-make_first] Error 2
【问题讨论】:
我能够通过删除-opengl es2
使其编译。这当然是不可取的,因为它会禁用 OpenGL。
【参考方案1】:
我遇到了同样的错误,并通过添加 3 symlinks 使其正常工作:
在 sysroot/opt/vc/include/EGL
mv egl.h egl.h-old
mv eglext.h eglext.h-old
mv eglplatform.h eglplatform.h-old
ln -s /<...>/qtwebengine/src/3rdparty/chromium/third_party/khronos/EGL/eglext.h eglext.h
ln -s /<...>/qtwebengine/src/3rdparty/chromium/third_party/khronos/EGL/egl.h egl.h
ln -s /<...>/qtwebengine/src/3rdparty/chromium/third_party/khronos/EGL/eglplatform.h eglplatform.h
其中<...>是qt根目录的路径。
有许多版本的 egl.h/eglext.h/eglplatform.h 要包含,并且由于包含顺序,编译器首先获取 sysroot/opt/vc/include/EGL 中的文件
也许更好的解决方案是为编译器重新排序“-I”标志。
我做了没有 dpkg --purge libraspberrypi-dev
【讨论】:
以上是关于qt应用程序编译时的问题的主要内容,如果未能解决你的问题,请参考以下文章