QT:编译问题整理


编译错误

undefined reference to ‘accept4’

打开文件qplatformdefs.h增加
#undef O_CLOEXEC
此处主要为解决:编译过程中找不到accept4函数问题

error: ‘stderr’ was not declared in this scope

出现版本:5.12.1 编译器,HISIV500 UCLIBC

arm-hisiv500-linux-g++ -c -pipe -mcpu=cortex-a7 -mfloat-abi=softfp -mfpu=neon-vfpv4 -mno-unaligned-access -fno-aggressive-loop-optimizations -O3 -fPIC -std=c++1y -fvisibility=hidden -fvisibility-inlines-hidden -ffunction-sections -fdata-sections -Wall -W -Wvla -Wno-missing-field-initializers -D_REENTRANT -DQT_NO_USING_NAMESPACE -DQT_NO_FOREACH -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_BUILD_CORE_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 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DPCRE2_CODE_UNIT_WIDTH=16 -I. -I../3rdparty/zlib/src -Iglobal -I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4 -I../3rdparty/sha3 -I../3rdparty -I../3rdparty/double-conversion/include -I../3rdparty/double-conversion/include/double-conversion -I../3rdparty/forkfd -I../3rdparty/tinycbor/src -I../../include -I../../include/QtCore -I../../include/QtCore/5.12.1 -I../../include/QtCore/5.12.1/QtCore -I.moc -I.tracegen -I../3rdparty/pcre2/src -I../../mkspecs/arm-hisiv500A7-linux-g++ -o .obj/qhash.o tools/qhash.cpp
tools/qhash.cpp: In function ‘uint qt_create_qhash_seed()’:
tools/qhash.cpp:293:21: error: ‘stderr’ was not declared in this scope
...
make[3]: Leaving directory '/nfsdir/justchen/sourceCode/qt-everywhere-src-5.12.1/qtbase/src/corelib'

修改文件/nfsdir/justchen/sourceCode/qt-everywhere-src-5.12.1/qtbase/src/corelib/tools/qhash.cpp 添加 #include <stdio.h>


发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注