qt-everywhere-opensource-src-4.8.1 出错:error: 'IPV6_MULTICAST_HOPS' was not declared in this scope

在编译:qt-everywhere-opensource-src-4.8.1出现如下错误:

/opt/buildroot-2011.11/arm920t/usr/bin/arm-linux-g++ -c -include .pch/release-shared-emb-arm/QtNetwork -pipe -fno-exceptions -O2 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -D_REENTRANT -fPIC -DQT_SHARED -DQT_BUILD_NETWORK_LIB -DQT_NO_USING_NAMESPACE -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT3_SUPPORT -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_NO_DEBUG -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../mkspecs/qws/linux-arm-g++ -I. -I../../include/QtCore -I../../include -I../../include/QtNetwork -I.rcc/release-shared-emb-arm -Ikernel -I.moc/release-shared-emb-arm -o .obj/release-shared-emb-arm/qnativesocketengine_unix.o socket/qnativesocketengine_unix.cpp
socket/qnativesocketengine_unix.cpp: In member function 'int QNativeSocketEnginePrivate::option(QAbstractSocketEngine::SocketOption) const':
socket/qnativesocketengine_unix.cpp:249: error: 'IPV6_MULTICAST_HOPS' was not declared in this scope
socket/qnativesocketengine_unix.cpp:261: error: 'IPV6_MULTICAST_LOOP' was not declared in this scope
socket/qnativesocketengine_unix.cpp: In member function 'bool QNativeSocketEnginePrivate::setOption(QAbstractSocketEngine::SocketOption, int)':
socket/qnativesocketengine_unix.cpp:354: error: 'IPV6_MULTICAST_HOPS' was not declared in this scope
socket/qnativesocketengine_unix.cpp:366: error: 'IPV6_MULTICAST_LOOP' was not declared in this scope
socket/qnativesocketengine_unix.cpp: In member function 'bool QNativeSocketEnginePrivate::nativeJoinMulticastGroup(const QHostAddress&, const QNetworkInterface&)':
socket/qnativesocketengine_unix.cpp:681: error: 'IPV6_JOIN_GROUP' was not declared in this scope
socket/qnativesocketengine_unix.cpp: In member function 'bool QNativeSocketEnginePrivate::nativeLeaveMulticastGroup(const QHostAddress&, const QNetworkInterface&)':
socket/qnativesocketengine_unix.cpp:695: error: 'IPV6_LEAVE_GROUP' was not declared in this scope
socket/qnativesocketengine_unix.cpp: In member function 'QNetworkInterface QNativeSocketEnginePrivate::nativeMulticastInterface() const':
socket/qnativesocketengine_unix.cpp:710: error: 'IPV6_MULTICAST_IF' was not declared in this scope
socket/qnativesocketengine_unix.cpp: In member function 'bool QNativeSocketEnginePrivate::nativeSetMulticastInterface(const QNetworkInterface&)':
socket/qnativesocketengine_unix.cpp:741: error: 'IPV6_MULTICAST_IF' was not declared in this scope
gmake[1]: *** [.obj/release-shared-emb-arm/qnativesocketengine_unix.o] Error 1
gmake[1]: Leaving directory `/home/chenzhenwei/embededproject/systools/qt4/qt-everywhere-opensource-src-4.8.1/src/network'
gmake: *** [sub-network-make_default-ordered] Error 2

明显,缺少IPV6_MULTICAST_XXXX等一系列定义,在src/network/socket/目录下创建ctags之后,发现这些宏定义在bits/in.h里面存在,我直接把头文件添加到里面,有显示重定义错误。

In file included from socket/qnativesocketengine_unix.cpp:42:
/opt/buildroot-2011.11/arm920t/usr/arm-unknown-linux-uclibcgnueabi/sysroot/usr/include/bits/in.h:22:3: error: #error "Never use <bits/in.h> directly; include <netinet/in.h> instead."
In file included from socket/qnativesocketengine_unix.cpp:42:
/opt/buildroot-2011.11/arm920t/usr/arm-unknown-linux-uclibcgnueabi/sysroot/usr/include/bits/in.h:84: error: field 'ip_dst' has incomplete type
/opt/buildroot-2011.11/arm920t/usr/arm-unknown-linux-uclibcgnueabi/sysroot/usr/include/bits/in.h:91: error: field 'imr_multiaddr' has incomplete type
/opt/buildroot-2011.11/arm920t/usr/arm-unknown-linux-uclibcgnueabi/sysroot/usr/include/bits/in.h:92: error: field 'imr_address' has incomplete type
/opt/buildroot-2011.11/arm920t/usr/arm-unknown-linux-uclibcgnueabi/sysroot/usr/include/bits/in.h:100: error: field 'ipi_spec_dst' has incomplete type
/opt/buildroot-2011.11/arm920t/usr/arm-unknown-linux-uclibcgnueabi/sysroot/usr/include/bits/in.h:101: error: field 'ipi_addr' has incomplete type
In file included from /opt/buildroot-2011.11/arm920t/usr/arm-unknown-linux-uclibcgnueabi/sysroot/usr/include/netinet/in.h:368,
                 from ../../mkspecs/qws/linux-arm-g++/../../linux-g++/qplatformdefs.h:79,
                 from ../../mkspecs/qws/linux-arm-g++/qplatformdefs.h:42,
                 from socket/qnativesocketengine_p.h:58,
                 from socket/qnativesocketengine_unix.cpp:45:
/opt/buildroot-2011.11/arm920t/usr/arm-unknown-linux-uclibcgnueabi/sysroot/usr/include/bits/in.h:82: error: redefinition of 'struct ip_opts'
/opt/buildroot-2011.11/arm920t/usr/arm-unknown-linux-uclibcgnueabi/sysroot/usr/include/bits/in.h:83: error: previous definition of 'struct ip_opts'
/opt/buildroot-2011.11/arm920t/usr/arm-unknown-linux-uclibcgnueabi/sysroot/usr/include/bits/in.h:89: error: redefinition of 'struct ip_mreqn'
/opt/buildroot-2011.11/arm920t/usr/arm-unknown-linux-uclibcgnueabi/sysroot/usr/include/bits/in.h:90: error: previous definition of 'struct ip_mreqn'
/opt/buildroot-2011.11/arm920t/usr/arm-unknown-linux-uclibcgnueabi/sysroot/usr/include/bits/in.h:97: error: redefinition of 'struct in_pktinfo'
/opt/buildroot-2011.11/arm920t/usr/arm-unknown-linux-uclibcgnueabi/sysroot/usr/include/bits/in.h:98: error: previous definition of 'struct in_pktinfo'

看来,他只需要这几个宏定义,那么我们就直接把他需要的几个宏定义copy过来用可以了。

#define IPV6_MULTICAST_IF   17
#define IPV6_MULTICAST_HOPS 18
#define IPV6_MULTICAST_LOOP 19
#define IPV6_JOIN_GROUP     20
#define IPV6_LEAVE_GROUP    21

OK,问题到此解决。

qt-everywhere-opensource-src-4.8.1 出错:error: 'IPV6_MULTICAST_HOPS' was not declared in this scope

时间: 2024-10-10 01:15:04

qt-everywhere-opensource-src-4.8.1 出错:error: 'IPV6_MULTICAST_HOPS' was not declared in this scope的相关文章

Qt for android运行时出错 Error: Target id &#39;android--1&#39; is not valid

[提问]windows7下Qt for android运行时出错 Error: Target id 'android--1' is not valid[复制链接] 上一主题下一主题   离线yijunziran 新手上路 加关注 发消息 只看楼主 倒序阅读楼主  发表于: 2015-04-11 程序是正确的,在Window环境下运行OKAndroid模拟器能跑起来. 在Android上运行时出现这种情况 22:19:48: 进程"D:\Qt\Qt5.4.1\Tools\mingw491_32\b

winpcap示例程序采用VC6编译时出错error C2054: expected &#39;(&#39; to follow &#39;_W64&#39;

e:\vehiclesecurity\wpdpack_4_1_2\include\pcap-stdinc.h(80) : error C2054: expected '(' to follow '_W64' e:\vehiclesecurity\wpdpack_4_1_2\include\pcap-stdinc.h(80) : error C2085: 'uintptr_t' : not in formal parameter list e:\vehiclesecurity\wpdpack_4_

win7下安装matlab后打开出错&ldquo;error starting desktop&rdquo;的解决办法

在matlab快捷图标上右键,选择"还原以前的版本"--"兼容性"选项卡,在"以兼容模式运行这个程序"前面打勾,并选择"windows vista",在下面的"特权等级"中,勾选"以管理员身份运行此程序".OK,到这里就解决了.[注意]是用"windows vista"系列的兼容模式,不要用XP兼容模式!   参考自:http://zhidao.baidu.com/l

mysql 数据库还原出错ERROR:Unknown command &#39;\&#39; mysql中断

其实造成这个问题的原因还是由于编码的问题,网站数据库设置的是gbk 的,mysql默认是gbk:但是在导出数据的时候导出了utf8的sql文件,不管我如何重新导入,在连接数据库后使用set names utf8:都不行,如果用gbk导入一是一直是乱码也会出错,在网上找了好久刚好有个和我一样的问题 .她的解决方法如下 在连接服务器端时命令中指定编码,如下形式 >mysql -uroot -pxxxxxx --default-character-set=utf8 我试了不行,出错,提示mysql默认

mysql出错ERROR 2003 (HY000): Can&#39;t connect to MySQL server on &#39;localhost&#39; (10061)

其他的贴会教你 1.键盘上win+r 2.输入cmd 3.输入net  start mysql 但是还是没用 你可以试试 1.右击开始菜单 2.点击windows PowerShell(i) 3.输入net  start mysql 4.输入mysql -u**** -p***** 上面的****代表你的账号密码,-u账号,-p密码, 我的账号:root 密码:123456, 那我就输入mysql -uroot -p123456 mysql出错ERROR 2003 (HY000): Can't

win7+vs2010+Qt addin新建win32控制台程序编译出错问题

最近遇到一个问题,每次新建win32控制台 应用程序,编译的时候都会莫名其妙地出现一个问题:LINK : fatal error LNK1123: failure during conversion to COFF: file invalid. 具体也不知道啥意思:但是解决方法是: 1.因为虽然是win32程序,但是引用的库都是64位的,所以要把程序改为x64的 2.修改工程属性,由yes改为no,如下图所示: 版权声明:本文为博主原创文章,未经博主允许不得转载.

Nginx 启动出错 error while loading shared libraries: libpcre.so.1

在 centos 6.5  64位上编译安装nginx1.63语法检查出错[root @localhost conf]# /usr/local/nginx/sbin/nginx -t /usr/local/nginx/sbin/nginx: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory 从错误看出是缺少lib文件导致,进一步

Linux终端运行java源码出错——Error: Could not find or load main class [duplicate]

Linux终端中运行.class文件出错

yum 安装 出错 Error: Protected multilib versions:

例如:安装zlib出错 yum install zlib-1.2.3-29.el6.i686 Error: Protected multilib versions: zlib-1.2.3-29.el6.i686 != zlib-1.2.3-27.el6.x86_64?You could try using --skip-broken to work around the problem?You could try running: rpm -Va --nofiles --nodigest ? 原