ushare编译之 ‘struct sockaddr_storage’ has no member named ‘s_addr’
编译ushare的时候出现‘struct sockaddr_storage’ has no member named ‘s_addr’
这是使用libupnp1.6.19出现版本号不兼容的错误。
解决方法:libupnp换成1.4.2版本号
配置:
----------------------------------------------------------------------------------------------------
$ ./configure
Checking forcompiler available...
Checking for locales...
Checking for ifaddrs...
Checking forlanginfo ...
Checking for iconv...
Checking for libixml...
Checking forlibthreadutil ...
Checkingfor libupnp >= 1.4.2 ...
uShare: configure isOK
version 1.1a
using libupnp 1.6.19
configuration:
install prefix /usr/local
configuration dir ${PREFIX}/etc
locales dir ${PREFIX}/share/locale
NLS support yes
DLNA support no
C compiler gcc
STRIP strip
make make
CPU x86 ()
debug symbols no
strip symbols yes
optimize yes
CFLAGS -I.. -W -Wall -D_LARGEFILE_SOURCE-D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_GNU_SOURCE -O3 -DHAVE_LOCALE_H-DHAVE_SETLOCALE -DHAVE_IFADDRS_H -DHAVE_LANGINFO_H -DHAVE_LANGINFO_CODESET-DHAVE_ICONV
-pthread -I/usr/local/include/upnp
LDFLAGS
extralibs -lixml -lthreadutil -lpthread -lupnp-pthread -L/usr/local/lib
Creating config.mak...
Creating config.h...
-------------------------------------------------------------------------------------------------
须要开启DLNA支持的话,使用:
$./configure --enablle-dlna
编译:
$make
----------------------------------------------------------------------------
…
ushare.c: Infunction ‘handle_action_request’:
ushare.c:191:29:error: ‘struct sockaddr_storage’ has no member named ‘s_addr’
make[1]: ***[ushare.o] Error 1
make[1]: Leavingdirectory `/home/won/Downloads/ushare-1.1a/src'
make: *** [all]Error 2
---------------------------------------------------------------------------
查看ushare.c文件相应内容:
…/src/ushare.c
-----------------------------------------------------------------------------------------------------------------------
191
ip = request->CtrlPtIPAddr.s_addr;
192 ip = ntohl (ip);
193 sprintf (val, "%d.%d.%d.%d",
194 (ip >> 24) & 0xFF, (ip>> 16) & 0xFF, (ip >> 8) & 0xFF, ip & 0xFF);
-----------------------------------------------------------------------------------------------------------------------
看看struct sockaddr_storage的定义在哪个头文件
-------------------------------------------------------------------------
$ grep -rn"struct sockaddr_storage" /usr/local/include/
/usr/local/include/upnp/upnp.h:632: struct sockaddr_storage CtrlPtIPAddr;
/usr/local/include/upnp/upnp.h:679: struct sockaddr_storage CtrlPtIPAddr;
/usr/local/include/upnp/upnp.h:759: struct sockaddr_storage DestAddr;
-------------------------------------------------------------------------
这里看到的都不是它的定义
找了非常久还是没有发现它的定义,FQgoogle一下:
还有这个:
还是乖乖把libupnp换成1.4.2版本号吧。。。
ushare编译之 ‘struct sockaddr_storage’ has no member named ‘s_addr’的更多相关文章
- 【Linux】解决"no member named 'max_align_t'
编译遇到错误: /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.1/../../../../include/c++/5.4.1/cstddef:51:11: erro ...
- 安装Stomp扩展时错误提示error: 'zend_class_entry' has no member named 'default_properties'
在安装stomp扩展时, 有这样的提示 error: 'zend_class_entry' has no member named 'default_properties' 交待下安装上下文, sto ...
- 错误:'class QApplication' has no member named 'setMainwidget'
错误:'class QApplication' has no member named 'setMainwidget' 转自:http://blog.csdn.net/chenqiai0/articl ...
- NDK 编译报错:request for member 'FindClass' in something not a structure or union
ndk编译 xx.c文件时一直报下面的错误: ”request for member 'FindClass' in something not a structure or union ...” 原因 ...
- Spark wordcount 编译错误 -- reduceByKey is not a member of RDD
Attempting to run http://spark.apache.org/docs/latest/quick-start.html#a-standalone-app-in-scala fro ...
- Solve error: 'class vtkImageActor' has no member named 'SetInput'
Replacement of SetInput() with SetInputData() and SetInputConnection() someFilter->SetInput(someR ...
- class Qstring has no member named to Ascii
人家修改了.真的没有toAscii了.不过可以用toLatin1或者qPrintable()
- No member named 'setResizeMode' in 'QHeaderView' - Convert Qt 4.7 to Qt 5.8
https://stackoverflow.com/questions/42743141/no-member-named-setresizemode-in-qheaderview-convert-qt ...
- Ubuntu 编译安装 Linux 4.0.5 内核,并修复 vmware 网络内核模块编译错误
. . . . . 今天把 Ubuntu 14.04 升级到了最新的 4.0.5 的内核版本,本来不打算记录下来的,但是升级的过程中确实遇到了一些问题,所以还是记录下来,分享给遇到同样问题的猿友. 先 ...
随机推荐
- Python的生成器Generator小结
一. 生成器的介绍 在介绍生成器(Generator)之前,我们首先需要熟悉列表生成式,列表生成式是Python内置的简单又强大的用来创建列表的生成式. 举个例子, 如果我们想生成[1*1,2*2,3 ...
- MSP430之自动增益程控放大main备份
占位符 #include <msp430.h> #include "sys.h" #include "ps2.h" #include "1 ...
- docker 集群 kubernetes 1.8 构建
1.环境说明:操作系统:CentOS7Kubernetes 版本:v1.8.3Docker 版本:v17.06-ce master 192.168.10.220 etcd kube-apiser ...
- python2.7运行出现的Warning: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
运行出现如下错误 uncode编码警告:在unicode等价比较中,把两个参数同时转换为unicode编码失败.中断并认为他们不相等. windows下的字符串str默认编码是ascii,而pytho ...
- 使用iview如何使左上的添加按钮和右上的搜索框和边框对齐
使用iview如何使左上的添加按钮和右上的搜索框和边框对齐呢? 效果如下: 使用iview自带的Grid 栅格进行布局,但是由于按钮和搜索框的大小不正好是一个栅格的宽度,所以不是很好跳转,且栅格也不支 ...
- bzoj 2749 - 外星人
Description 给定一个数的标准分解\(N= \prod_{i=1}^n p_i^{q_i}\) 其中\(p_i \le 10^5, q_i \le 10^9\) 求最小的\(x\)使得\(\ ...
- POJ3311 Hie with the Pie
The Pizazz Pizzeria prides itself in delivering pizzas to its customers as fast as possible. Unfortu ...
- BZOJ【1625】宝石手镯
1625: [Usaco2007 Dec]宝石手镯 Time Limit: 5 Sec Memory Limit: 64 MBSubmit: 1007 Solved: 684[Submit][St ...
- [CODEVS1205]单词反转
给出一个英语句子,希望你把句子里的单词顺序都翻转过来 这个题算是第二次做了……第二次用的C++然而还是写不出来 思路1:用一个数组把读过去的单词存起来,再逆序输出即可 思路2:读入句子后,先在句子开头 ...
- input file 修改按钮名称
解决方法: 1)页面上放个隐藏的<input type=“file” /> 2)然后加上一个文本input(type="text")和一个按钮input(type=&q ...